diff --git a/CHANGELOG.md b/CHANGELOG.md index 83bff2d07..83815a67c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.123.0](https://github.com/googleapis/java-pubsub/compare/v1.122.2...v1.123.0) (2023-01-10) + + +### Features + +* Add schema evolution methods and fields ([#1384](https://github.com/googleapis/java-pubsub/issues/1384)) ([746a6e0](https://github.com/googleapis/java-pubsub/commit/746a6e040eb94d73bfbaece051d08c60c9885326)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.1 ([#1450](https://github.com/googleapis/java-pubsub/issues/1450)) ([2dcbcad](https://github.com/googleapis/java-pubsub/commit/2dcbcadfa56282733ab7998ec9cf360f0a71eaca)) + ## [1.122.2](https://github.com/googleapis/java-pubsub/compare/v1.122.1...v1.122.2) (2022-12-15) diff --git a/README.md b/README.md index ff71d5c59..4bb1dc429 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-pubsub - 1.122.1 + 1.122.2 ``` @@ -51,20 +51,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.5') +implementation platform('com.google.cloud:libraries-bom:26.3.0') implementation 'com.google.cloud:google-cloud-pubsub' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-pubsub:1.122.1' +implementation 'com.google.cloud:google-cloud-pubsub:1.122.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.122.1" +libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.122.2" ``` ## Authentication diff --git a/google-cloud-pubsub-bom/pom.xml b/google-cloud-pubsub-bom/pom.xml index 9af4bea7d..4ed77c545 100644 --- a/google-cloud-pubsub-bom/pom.xml +++ b/google-cloud-pubsub-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-pubsub-bom - 1.122.2 + 1.123.0 pom com.google.cloud @@ -52,17 +52,17 @@ com.google.cloud google-cloud-pubsub - 1.122.2 + 1.123.0 com.google.api.grpc grpc-google-cloud-pubsub-v1 - 1.104.2 + 1.105.0 com.google.api.grpc proto-google-cloud-pubsub-v1 - 1.104.2 + 1.105.0 diff --git a/google-cloud-pubsub/pom.xml b/google-cloud-pubsub/pom.xml index 484360163..32c8fb89a 100644 --- a/google-cloud-pubsub/pom.xml +++ b/google-cloud-pubsub/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-pubsub - 1.122.2 + 1.123.0 jar Google Cloud Pub/Sub https://github.com/googleapis/java-pubsub @@ -11,7 +11,7 @@ com.google.cloud google-cloud-pubsub-parent - 1.122.2 + 1.123.0 google-cloud-pubsub 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 index 475877648..2444f6b81 100644 --- 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 @@ -33,12 +33,17 @@ 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; @@ -135,10 +140,7 @@ * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * SchemaServiceSettings schemaServiceSettings = - * SchemaServiceSettings.newBuilder() - * .setTransportChannelProvider( - * SchemaServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) - * .build(); + * SchemaServiceSettings.newHttpJsonBuilder().build(); * SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings); * } * @@ -613,6 +615,544 @@ public final UnaryCallable listSchemasC 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 Required. The revision ID to roll back to. It must be a revision of the same + * schema. + *

Example: c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema deleteSchemaRevision(SchemaName name, String revisionId) { + DeleteSchemaRevisionRequest request = + DeleteSchemaRevisionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setRevisionId(revisionId) + .build(); + return deleteSchemaRevision(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific schema revision. + * + *

Sample code: + * + *

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

Example: projects/123/schemas/my-schema{@literal @}c7cfa2a8 + * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same + * schema. + *

Example: c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema deleteSchemaRevision(String name, String revisionId) { + DeleteSchemaRevisionRequest request = + DeleteSchemaRevisionRequest.newBuilder().setName(name).setRevisionId(revisionId).build(); + return deleteSchemaRevision(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific schema revision. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   DeleteSchemaRevisionRequest request =
+   *       DeleteSchemaRevisionRequest.newBuilder()
+   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   ApiFuture future =
+   *       schemaServiceClient.deleteSchemaRevisionCallable().futureCall(request);
+   *   // Do something.
+   *   Schema response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSchemaRevisionCallable() { + return stub.deleteSchemaRevisionCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a schema. @@ -1199,4 +1739,84 @@ protected ListSchemasFixedSizeCollection createCollection( return new ListSchemasFixedSizeCollection(pages, collectionSize); } } + + public static class ListSchemaRevisionsPagedResponse + extends AbstractPagedListResponse< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + Schema, + ListSchemaRevisionsPage, + ListSchemaRevisionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSchemaRevisionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSchemaRevisionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSchemaRevisionsPagedResponse(ListSchemaRevisionsPage page) { + super(page, ListSchemaRevisionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSchemaRevisionsPage + extends AbstractPage< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + Schema, + ListSchemaRevisionsPage> { + + private ListSchemaRevisionsPage( + PageContext context, + ListSchemaRevisionsResponse response) { + super(context, response); + } + + private static ListSchemaRevisionsPage createEmptyPage() { + return new ListSchemaRevisionsPage(null, null); + } + + @Override + protected ListSchemaRevisionsPage createPage( + PageContext context, + ListSchemaRevisionsResponse response) { + return new ListSchemaRevisionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSchemaRevisionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + Schema, + ListSchemaRevisionsPage, + ListSchemaRevisionsFixedSizeCollection> { + + private ListSchemaRevisionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSchemaRevisionsFixedSizeCollection createEmptyCollection() { + return new ListSchemaRevisionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSchemaRevisionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSchemaRevisionsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java index 4d13f3660..e01dbf09c 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.core.ApiFunction; @@ -37,11 +38,16 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -78,7 +84,10 @@ * schemaServiceSettingsBuilder * .createSchemaSettings() * .setRetrySettings( - * schemaServiceSettingsBuilder.createSchemaSettings().getRetrySettings().toBuilder() + * schemaServiceSettingsBuilder + * .createSchemaSettings() + * .getRetrySettings() + * .toBuilder() * .setTotalTimeout(Duration.ofSeconds(30)) * .build()); * SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); @@ -103,6 +112,28 @@ public UnaryCallSettings getSchemaSettings() { return ((SchemaServiceStubSettings) getStubSettings()).listSchemasSettings(); } + /** Returns the object with the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).listSchemaRevisionsSettings(); + } + + /** Returns the object with the settings used for calls to commitSchema. */ + public UnaryCallSettings commitSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).commitSchemaSettings(); + } + + /** Returns the object with the settings used for calls to rollbackSchema. */ + public UnaryCallSettings rollbackSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).rollbackSchemaSettings(); + } + + /** Returns the object with the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings deleteSchemaRevisionSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaRevisionSettings(); + } + /** Returns the object with the settings used for calls to deleteSchema. */ public UnaryCallSettings deleteSchemaSettings() { return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaSettings(); @@ -267,6 +298,31 @@ public UnaryCallSettings.Builder getSchemaSettings() { return getStubSettingsBuilder().listSchemasSettings(); } + /** Returns the builder for the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings.Builder< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return getStubSettingsBuilder().listSchemaRevisionsSettings(); + } + + /** Returns the builder for the settings used for calls to commitSchema. */ + public UnaryCallSettings.Builder commitSchemaSettings() { + return getStubSettingsBuilder().commitSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to rollbackSchema. */ + public UnaryCallSettings.Builder rollbackSchemaSettings() { + return getStubSettingsBuilder().rollbackSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings.Builder + deleteSchemaRevisionSettings() { + return getStubSettingsBuilder().deleteSchemaRevisionSettings(); + } + /** Returns the builder for the settings used for calls to deleteSchema. */ public UnaryCallSettings.Builder deleteSchemaSettings() { return getStubSettingsBuilder().deleteSchemaSettings(); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java index 4370109a2..74157333a 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java @@ -161,10 +161,7 @@ * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * SubscriptionAdminSettings subscriptionAdminSettings = - * SubscriptionAdminSettings.newBuilder() - * .setTransportChannelProvider( - * SubscriptionAdminSettings.defaultHttpJsonTransportProviderBuilder().build()) - * .build(); + * SubscriptionAdminSettings.newHttpJsonBuilder().build(); * SubscriptionAdminClient subscriptionAdminClient = * SubscriptionAdminClient.create(subscriptionAdminSettings); * } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java index 8d9b5f91b..7a39d7bd6 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java @@ -139,11 +139,7 @@ * // - It may require correct/in-range values for request initialization. * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - * TopicAdminSettings topicAdminSettings = - * TopicAdminSettings.newBuilder() - * .setTransportChannelProvider( - * TopicAdminSettings.defaultHttpJsonTransportProviderBuilder().build()) - * .build(); + * TopicAdminSettings topicAdminSettings = TopicAdminSettings.newHttpJsonBuilder().build(); * TopicAdminClient topicAdminClient = TopicAdminClient.create(topicAdminSettings); * } * diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java index adc9e92c5..b18ecf1ca 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java @@ -85,7 +85,10 @@ * topicAdminSettingsBuilder * .createTopicSettings() * .setRetrySettings( - * topicAdminSettingsBuilder.createTopicSettings().getRetrySettings().toBuilder() + * topicAdminSettingsBuilder + * .createTopicSettings() + * .getRetrySettings() + * .toBuilder() * .setTotalTimeout(Duration.ofSeconds(30)) * .build()); * TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build(); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json index 8efac12d0..ff5a589d6 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json @@ -121,21 +121,33 @@ "grpc": { "libraryClient": "SchemaServiceClient", "rpcs": { + "CommitSchema": { + "methods": ["commitSchema", "commitSchema", "commitSchema", "commitSchemaCallable"] + }, "CreateSchema": { "methods": ["createSchema", "createSchema", "createSchema", "createSchemaCallable"] }, "DeleteSchema": { "methods": ["deleteSchema", "deleteSchema", "deleteSchema", "deleteSchemaCallable"] }, + "DeleteSchemaRevision": { + "methods": ["deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevisionCallable"] + }, "GetIamPolicy": { "methods": ["getIamPolicy", "getIamPolicyCallable"] }, "GetSchema": { "methods": ["getSchema", "getSchema", "getSchema", "getSchemaCallable"] }, + "ListSchemaRevisions": { + "methods": ["listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisionsPagedCallable", "listSchemaRevisionsCallable"] + }, "ListSchemas": { "methods": ["listSchemas", "listSchemas", "listSchemas", "listSchemasPagedCallable", "listSchemasCallable"] }, + "RollbackSchema": { + "methods": ["rollbackSchema", "rollbackSchema", "rollbackSchema", "rollbackSchemaCallable"] + }, "SetIamPolicy": { "methods": ["setIamPolicy", "setIamPolicyCallable"] }, diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java index 4d06023b7..aa4a91eb2 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -32,11 +33,16 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -82,6 +88,45 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { ProtoUtils.marshaller(ListSchemasResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listSchemaRevisionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemaRevisions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSchemaRevisionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSchemaRevisionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor commitSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/CommitSchema") + .setRequestMarshaller(ProtoUtils.marshaller(CommitSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + rollbackSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/RollbackSchema") + .setRequestMarshaller( + ProtoUtils.marshaller(RollbackSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteSchemaRevisionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchemaRevision") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSchemaRevisionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteSchemaMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -144,6 +189,13 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { private final UnaryCallable listSchemasCallable; private final UnaryCallable listSchemasPagedCallable; + private final UnaryCallable + listSchemaRevisionsCallable; + private final UnaryCallable + listSchemaRevisionsPagedCallable; + private final UnaryCallable commitSchemaCallable; + private final UnaryCallable rollbackSchemaCallable; + private final UnaryCallable deleteSchemaRevisionCallable; private final UnaryCallable deleteSchemaCallable; private final UnaryCallable validateSchemaCallable; private final UnaryCallable @@ -225,6 +277,47 @@ protected GrpcSchemaServiceStub( return params.build(); }) .build(); + GrpcCallSettings + listSchemaRevisionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSchemaRevisionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings commitSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(commitSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings rollbackSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rollbackSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteSchemaRevisionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSchemaRevisionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); GrpcCallSettings deleteSchemaTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSchemaMethodDescriptor) @@ -301,6 +394,27 @@ protected GrpcSchemaServiceStub( this.listSchemasPagedCallable = callableFactory.createPagedCallable( listSchemasTransportSettings, settings.listSchemasSettings(), clientContext); + this.listSchemaRevisionsCallable = + callableFactory.createUnaryCallable( + listSchemaRevisionsTransportSettings, + settings.listSchemaRevisionsSettings(), + clientContext); + this.listSchemaRevisionsPagedCallable = + callableFactory.createPagedCallable( + listSchemaRevisionsTransportSettings, + settings.listSchemaRevisionsSettings(), + clientContext); + this.commitSchemaCallable = + callableFactory.createUnaryCallable( + commitSchemaTransportSettings, settings.commitSchemaSettings(), clientContext); + this.rollbackSchemaCallable = + callableFactory.createUnaryCallable( + rollbackSchemaTransportSettings, settings.rollbackSchemaSettings(), clientContext); + this.deleteSchemaRevisionCallable = + callableFactory.createUnaryCallable( + deleteSchemaRevisionTransportSettings, + settings.deleteSchemaRevisionSettings(), + clientContext); this.deleteSchemaCallable = callableFactory.createUnaryCallable( deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext); @@ -350,6 +464,33 @@ public UnaryCallable listSchemasPa return listSchemasPagedCallable; } + @Override + public UnaryCallable + listSchemaRevisionsCallable() { + return listSchemaRevisionsCallable; + } + + @Override + public UnaryCallable + listSchemaRevisionsPagedCallable() { + return listSchemaRevisionsPagedCallable; + } + + @Override + public UnaryCallable commitSchemaCallable() { + return commitSchemaCallable; + } + + @Override + public UnaryCallable rollbackSchemaCallable() { + return rollbackSchemaCallable; + } + + @Override + public UnaryCallable deleteSchemaRevisionCallable() { + return deleteSchemaRevisionCallable; + } + @Override public UnaryCallable deleteSchemaCallable() { return deleteSchemaCallable; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java index 2e42c14c7..f7a458447 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java @@ -91,12 +91,13 @@ public class HttpJsonPublisherStub extends PublisherStub { request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), false)) + .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -126,12 +127,13 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) + .toBody("*", request.toBuilder().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -162,12 +164,13 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearTopic().build(), false)) + .toBody("*", request.toBuilder().clearTopic().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -197,6 +200,7 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -232,6 +236,7 @@ public class HttpJsonPublisherStub extends PublisherStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -269,6 +274,7 @@ public class HttpJsonPublisherStub extends PublisherStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -304,6 +310,7 @@ public class HttpJsonPublisherStub extends PublisherStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -336,6 +343,7 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -370,6 +378,7 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -407,12 +416,13 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -447,6 +457,7 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -484,12 +495,13 @@ public class HttpJsonPublisherStub extends PublisherStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java index 5112de2e5..c3a607bf6 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.core.BetaApi; @@ -37,11 +38,16 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -89,12 +95,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "schemaId", request.getSchemaId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("schema", request.getSchema(), false)) + .toBody("schema", request.getSchema(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -125,6 +132,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -161,6 +169,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -172,6 +181,152 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { .build()) .build(); + private static final ApiMethodDescriptor + listSchemaRevisionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemaRevisions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/schemas/*}:listRevisions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSchemaRevisionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + commitSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.pubsub.v1.SchemaService/CommitSchema") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/schemas/*}:commit", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Schema.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + rollbackSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.pubsub.v1.SchemaService/RollbackSchema") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/schemas/*}:rollback", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Schema.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSchemaRevisionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchemaRevision") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/schemas/*}:deleteRevision", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "revisionId", request.getRevisionId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Schema.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor deleteSchemaMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -194,6 +349,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -227,12 +383,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) + .toBody("*", request.toBuilder().clearParent().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -263,12 +420,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) + .toBody("*", request.toBuilder().clearParent().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -303,12 +461,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -343,6 +502,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -380,12 +540,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -399,6 +560,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub { private final UnaryCallable listSchemasCallable; private final UnaryCallable listSchemasPagedCallable; + private final UnaryCallable + listSchemaRevisionsCallable; + private final UnaryCallable + listSchemaRevisionsPagedCallable; + private final UnaryCallable commitSchemaCallable; + private final UnaryCallable rollbackSchemaCallable; + private final UnaryCallable deleteSchemaRevisionCallable; private final UnaryCallable deleteSchemaCallable; private final UnaryCallable validateSchemaCallable; private final UnaryCallable @@ -465,6 +633,29 @@ protected HttpJsonSchemaServiceStub( .setMethodDescriptor(listSchemasMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + listSchemaRevisionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listSchemaRevisionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings commitSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(commitSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings rollbackSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rollbackSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteSchemaRevisionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSchemaRevisionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings deleteSchemaTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteSchemaMethodDescriptor) @@ -511,6 +702,27 @@ protected HttpJsonSchemaServiceStub( this.listSchemasPagedCallable = callableFactory.createPagedCallable( listSchemasTransportSettings, settings.listSchemasSettings(), clientContext); + this.listSchemaRevisionsCallable = + callableFactory.createUnaryCallable( + listSchemaRevisionsTransportSettings, + settings.listSchemaRevisionsSettings(), + clientContext); + this.listSchemaRevisionsPagedCallable = + callableFactory.createPagedCallable( + listSchemaRevisionsTransportSettings, + settings.listSchemaRevisionsSettings(), + clientContext); + this.commitSchemaCallable = + callableFactory.createUnaryCallable( + commitSchemaTransportSettings, settings.commitSchemaSettings(), clientContext); + this.rollbackSchemaCallable = + callableFactory.createUnaryCallable( + rollbackSchemaTransportSettings, settings.rollbackSchemaSettings(), clientContext); + this.deleteSchemaRevisionCallable = + callableFactory.createUnaryCallable( + deleteSchemaRevisionTransportSettings, + settings.deleteSchemaRevisionSettings(), + clientContext); this.deleteSchemaCallable = callableFactory.createUnaryCallable( deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext); @@ -542,6 +754,10 @@ public static List getMethodDescriptors() { methodDescriptors.add(createSchemaMethodDescriptor); methodDescriptors.add(getSchemaMethodDescriptor); methodDescriptors.add(listSchemasMethodDescriptor); + methodDescriptors.add(listSchemaRevisionsMethodDescriptor); + methodDescriptors.add(commitSchemaMethodDescriptor); + methodDescriptors.add(rollbackSchemaMethodDescriptor); + methodDescriptors.add(deleteSchemaRevisionMethodDescriptor); methodDescriptors.add(deleteSchemaMethodDescriptor); methodDescriptors.add(validateSchemaMethodDescriptor); methodDescriptors.add(validateMessageMethodDescriptor); @@ -571,6 +787,33 @@ public UnaryCallable listSchemasPa return listSchemasPagedCallable; } + @Override + public UnaryCallable + listSchemaRevisionsCallable() { + return listSchemaRevisionsCallable; + } + + @Override + public UnaryCallable + listSchemaRevisionsPagedCallable() { + return listSchemaRevisionsPagedCallable; + } + + @Override + public UnaryCallable commitSchemaCallable() { + return commitSchemaCallable; + } + + @Override + public UnaryCallable rollbackSchemaCallable() { + return rollbackSchemaCallable; + } + + @Override + public UnaryCallable deleteSchemaRevisionCallable() { + return deleteSchemaRevisionCallable; + } + @Override public UnaryCallable deleteSchemaCallable() { return deleteSchemaCallable; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java index 49546ad5d..fb9b368a8 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java @@ -99,12 +99,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), false)) + .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -136,6 +137,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -170,12 +172,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) + .toBody("*", request.toBuilder().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -208,6 +211,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -242,6 +246,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -276,13 +281,14 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody( - "*", request.toBuilder().clearSubscription().build(), false)) + "*", request.toBuilder().clearSubscription().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -312,12 +318,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearSubscription().build(), false)) + .toBody("*", request.toBuilder().clearSubscription().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -345,12 +352,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearSubscription().build(), false)) + .toBody("*", request.toBuilder().clearSubscription().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -382,13 +390,14 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody( - "*", request.toBuilder().clearSubscription().build(), false)) + "*", request.toBuilder().clearSubscription().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -419,6 +428,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -454,6 +464,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -487,12 +498,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), false)) + .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -524,12 +536,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) + .toBody("*", request.toBuilder().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -560,6 +573,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -590,12 +604,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearSubscription().build(), false)) + .toBody("*", request.toBuilder().clearSubscription().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -630,12 +645,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -670,6 +686,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -707,12 +724,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index 287162b97..c04234a61 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -111,7 +111,10 @@ * topicAdminSettingsBuilder * .createTopicSettings() * .setRetrySettings( - * topicAdminSettingsBuilder.createTopicSettings().getRetrySettings().toBuilder() + * topicAdminSettingsBuilder + * .createTopicSettings() + * .getRetrySettings() + * .toBuilder() * .setTotalTimeout(Duration.ofSeconds(30)) * .build()); * PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build(); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java index 47aac9109..01446db22 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -26,11 +27,16 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -63,6 +69,28 @@ public UnaryCallable listSchemasCallabl throw new UnsupportedOperationException("Not implemented: listSchemasCallable()"); } + public UnaryCallable + listSchemaRevisionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsPagedCallable()"); + } + + public UnaryCallable + listSchemaRevisionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsCallable()"); + } + + public UnaryCallable commitSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: commitSchemaCallable()"); + } + + public UnaryCallable rollbackSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: rollbackSchemaCallable()"); + } + + public UnaryCallable deleteSchemaRevisionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSchemaRevisionCallable()"); + } + public UnaryCallable deleteSchemaCallable() { throw new UnsupportedOperationException("Not implemented: deleteSchemaCallable()"); } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index ccf2d83bb..240ca05d0 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.core.ApiFunction; @@ -53,11 +54,16 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -95,7 +101,10 @@ * schemaServiceSettingsBuilder * .createSchemaSettings() * .setRetrySettings( - * schemaServiceSettingsBuilder.createSchemaSettings().getRetrySettings().toBuilder() + * schemaServiceSettingsBuilder + * .createSchemaSettings() + * .getRetrySettings() + * .toBuilder() * .setTotalTimeout(Duration.ofSeconds(30)) * .build()); * SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); @@ -114,6 +123,12 @@ public class SchemaServiceStubSettings extends StubSettings getSchemaSettings; private final PagedCallSettings listSchemasSettings; + private final PagedCallSettings< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings; + private final UnaryCallSettings commitSchemaSettings; + private final UnaryCallSettings rollbackSchemaSettings; + private final UnaryCallSettings deleteSchemaRevisionSettings; private final UnaryCallSettings deleteSchemaSettings; private final UnaryCallSettings validateSchemaSettings; @@ -160,6 +175,46 @@ public Iterable extractResources(ListSchemasResponse payload) { } }; + private static final PagedListDescriptor< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema> + LIST_SCHEMA_REVISIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSchemaRevisionsRequest injectToken( + ListSchemaRevisionsRequest payload, String token) { + return ListSchemaRevisionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSchemaRevisionsRequest injectPageSize( + ListSchemaRevisionsRequest payload, int pageSize) { + return ListSchemaRevisionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSchemaRevisionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSchemaRevisionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSchemaRevisionsResponse payload) { + return payload.getSchemasList() == null + ? ImmutableList.of() + : payload.getSchemasList(); + } + }; + private static final PagedListResponseFactory< ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> LIST_SCHEMAS_PAGE_STR_FACT = @@ -177,6 +232,27 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + LIST_SCHEMA_REVISIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSchemaRevisionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SCHEMA_REVISIONS_PAGE_STR_DESC, request, context); + return ListSchemaRevisionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createSchema. */ public UnaryCallSettings createSchemaSettings() { return createSchemaSettings; @@ -193,6 +269,28 @@ public UnaryCallSettings getSchemaSettings() { return listSchemasSettings; } + /** Returns the object with the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return listSchemaRevisionsSettings; + } + + /** Returns the object with the settings used for calls to commitSchema. */ + public UnaryCallSettings commitSchemaSettings() { + return commitSchemaSettings; + } + + /** Returns the object with the settings used for calls to rollbackSchema. */ + public UnaryCallSettings rollbackSchemaSettings() { + return rollbackSchemaSettings; + } + + /** Returns the object with the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings deleteSchemaRevisionSettings() { + return deleteSchemaRevisionSettings; + } + /** Returns the object with the settings used for calls to deleteSchema. */ public UnaryCallSettings deleteSchemaSettings() { return deleteSchemaSettings; @@ -334,6 +432,10 @@ protected SchemaServiceStubSettings(Builder settingsBuilder) throws IOException createSchemaSettings = settingsBuilder.createSchemaSettings().build(); getSchemaSettings = settingsBuilder.getSchemaSettings().build(); listSchemasSettings = settingsBuilder.listSchemasSettings().build(); + listSchemaRevisionsSettings = settingsBuilder.listSchemaRevisionsSettings().build(); + commitSchemaSettings = settingsBuilder.commitSchemaSettings().build(); + rollbackSchemaSettings = settingsBuilder.rollbackSchemaSettings().build(); + deleteSchemaRevisionSettings = settingsBuilder.deleteSchemaRevisionSettings().build(); deleteSchemaSettings = settingsBuilder.deleteSchemaSettings().build(); validateSchemaSettings = settingsBuilder.validateSchemaSettings().build(); validateMessageSettings = settingsBuilder.validateMessageSettings().build(); @@ -350,6 +452,15 @@ public static class Builder extends StubSettings.Builder listSchemasSettings; + private final PagedCallSettings.Builder< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings; + private final UnaryCallSettings.Builder commitSchemaSettings; + private final UnaryCallSettings.Builder rollbackSchemaSettings; + private final UnaryCallSettings.Builder + deleteSchemaRevisionSettings; private final UnaryCallSettings.Builder deleteSchemaSettings; private final UnaryCallSettings.Builder validateSchemaSettings; @@ -389,6 +500,11 @@ protected Builder(ClientContext clientContext) { createSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listSchemasSettings = PagedCallSettings.newBuilder(LIST_SCHEMAS_PAGE_STR_FACT); + listSchemaRevisionsSettings = + PagedCallSettings.newBuilder(LIST_SCHEMA_REVISIONS_PAGE_STR_FACT); + commitSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rollbackSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSchemaRevisionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); validateSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); validateMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -401,6 +517,10 @@ protected Builder(ClientContext clientContext) { createSchemaSettings, getSchemaSettings, listSchemasSettings, + listSchemaRevisionsSettings, + commitSchemaSettings, + rollbackSchemaSettings, + deleteSchemaRevisionSettings, deleteSchemaSettings, validateSchemaSettings, validateMessageSettings, @@ -416,6 +536,10 @@ protected Builder(SchemaServiceStubSettings settings) { createSchemaSettings = settings.createSchemaSettings.toBuilder(); getSchemaSettings = settings.getSchemaSettings.toBuilder(); listSchemasSettings = settings.listSchemasSettings.toBuilder(); + listSchemaRevisionsSettings = settings.listSchemaRevisionsSettings.toBuilder(); + commitSchemaSettings = settings.commitSchemaSettings.toBuilder(); + rollbackSchemaSettings = settings.rollbackSchemaSettings.toBuilder(); + deleteSchemaRevisionSettings = settings.deleteSchemaRevisionSettings.toBuilder(); deleteSchemaSettings = settings.deleteSchemaSettings.toBuilder(); validateSchemaSettings = settings.validateSchemaSettings.toBuilder(); validateMessageSettings = settings.validateMessageSettings.toBuilder(); @@ -428,6 +552,10 @@ protected Builder(SchemaServiceStubSettings settings) { createSchemaSettings, getSchemaSettings, listSchemasSettings, + listSchemaRevisionsSettings, + commitSchemaSettings, + rollbackSchemaSettings, + deleteSchemaRevisionSettings, deleteSchemaSettings, validateSchemaSettings, validateMessageSettings, @@ -478,6 +606,26 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .listSchemaRevisionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .commitSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .rollbackSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSchemaRevisionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .deleteSchemaSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -543,6 +691,31 @@ public UnaryCallSettings.Builder getSchemaSettings() { return listSchemasSettings; } + /** Returns the builder for the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings.Builder< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return listSchemaRevisionsSettings; + } + + /** Returns the builder for the settings used for calls to commitSchema. */ + public UnaryCallSettings.Builder commitSchemaSettings() { + return commitSchemaSettings; + } + + /** Returns the builder for the settings used for calls to rollbackSchema. */ + public UnaryCallSettings.Builder rollbackSchemaSettings() { + return rollbackSchemaSettings; + } + + /** Returns the builder for the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings.Builder + deleteSchemaRevisionSettings() { + return deleteSchemaRevisionSettings; + } + /** Returns the builder for the settings used for calls to deleteSchema. */ public UnaryCallSettings.Builder deleteSchemaSettings() { return deleteSchemaSettings; 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 index 6124aab4d..7f0464d47 100644 --- 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 @@ -19,11 +19,16 @@ 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; @@ -130,6 +135,90 @@ public void listSchemas( } } + @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(); 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 index c34c46f9d..e3289e3c2 100644 --- 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 @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -40,7 +41,9 @@ 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; @@ -101,6 +104,8 @@ public void createSchemaTest() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -150,6 +155,8 @@ public void createSchemaTest2() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -199,6 +206,8 @@ public void getSchemaTest() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -244,6 +253,8 @@ public void getSchemaTest2() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -383,6 +394,400 @@ public void listSchemasExceptionTest2() throws 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(); 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 index 60fadbced..aa234621f 100644 --- 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 @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -38,13 +39,19 @@ 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; @@ -112,6 +119,8 @@ public void createSchemaTest() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -157,6 +166,8 @@ public void createSchemaTest2() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -202,6 +213,8 @@ public void getSchemaTest() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -241,6 +254,8 @@ public void getSchemaTest2() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -362,6 +377,360 @@ public void listSchemasExceptionTest2() throws 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(); diff --git a/grpc-google-cloud-pubsub-v1/pom.xml b/grpc-google-cloud-pubsub-v1/pom.xml index e9798394b..1830f44db 100644 --- a/grpc-google-cloud-pubsub-v1/pom.xml +++ b/grpc-google-cloud-pubsub-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-pubsub-v1 - 1.104.2 + 1.105.0 grpc-google-cloud-pubsub-v1 GRPC library for grpc-google-cloud-pubsub-v1 com.google.cloud google-cloud-pubsub-parent - 1.122.2 + 1.123.0 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 index c8061efe2..9921f175e 100644 --- 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 @@ -155,6 +155,180 @@ private SchemaServiceGrpc() {} 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; @@ -371,6 +545,63 @@ public void listSchemas( getListSchemasMethod(), 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.ServerCalls.asyncUnimplementedUnaryCall( + getListSchemaRevisionsMethod(), 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.ServerCalls.asyncUnimplementedUnaryCall( + getCommitSchemaMethod(), 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.ServerCalls.asyncUnimplementedUnaryCall( + getRollbackSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a specific schema revision.
+     * 
+ */ + public void deleteSchemaRevision( + com.google.pubsub.v1.DeleteSchemaRevisionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSchemaRevisionMethod(), responseObserver); + } + /** * * @@ -435,6 +666,31 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.pubsub.v1.ListSchemasRequest, com.google.pubsub.v1.ListSchemasResponse>(this, METHODID_LIST_SCHEMAS))) + .addMethod( + getListSchemaRevisionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ListSchemaRevisionsRequest, + com.google.pubsub.v1.ListSchemaRevisionsResponse>( + this, METHODID_LIST_SCHEMA_REVISIONS))) + .addMethod( + getCommitSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.CommitSchemaRequest, com.google.pubsub.v1.Schema>( + this, METHODID_COMMIT_SCHEMA))) + .addMethod( + getRollbackSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema>( + this, METHODID_ROLLBACK_SCHEMA))) + .addMethod( + getDeleteSchemaRevisionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.DeleteSchemaRevisionRequest, + com.google.pubsub.v1.Schema>(this, METHODID_DELETE_SCHEMA_REVISION))) .addMethod( getDeleteSchemaMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -522,6 +778,71 @@ public void listSchemas( 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); + } + /** * * @@ -629,6 +950,58 @@ public com.google.pubsub.v1.ListSchemasResponse listSchemas( 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); + } + /** * * @@ -728,6 +1101,59 @@ protected SchemaServiceFutureStub build( 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); + } + /** * * @@ -773,9 +1199,13 @@ protected SchemaServiceFutureStub build( private static final int METHODID_CREATE_SCHEMA = 0; private static final int METHODID_GET_SCHEMA = 1; private static final int METHODID_LIST_SCHEMAS = 2; - private static final int METHODID_DELETE_SCHEMA = 3; - private static final int METHODID_VALIDATE_SCHEMA = 4; - private static final int METHODID_VALIDATE_MESSAGE = 5; + private static final 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, @@ -810,6 +1240,27 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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, @@ -894,6 +1345,10 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getCreateSchemaMethod()) .addMethod(getGetSchemaMethod()) .addMethod(getListSchemasMethod()) + .addMethod(getListSchemaRevisionsMethod()) + .addMethod(getCommitSchemaMethod()) + .addMethod(getRollbackSchemaMethod()) + .addMethod(getDeleteSchemaRevisionMethod()) .addMethod(getDeleteSchemaMethod()) .addMethod(getValidateSchemaMethod()) .addMethod(getValidateMessageMethod()) diff --git a/pom.xml b/pom.xml index d17770027..34f742ac6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-pubsub-parent pom - 1.122.2 + 1.123.0 Google Cloud Pub/Sub Parent https://github.com/googleapis/java-pubsub @@ -61,7 +61,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.1.0 + 3.1.1 pom import @@ -69,17 +69,17 @@ com.google.api.grpc proto-google-cloud-pubsub-v1 - 1.104.2 + 1.105.0 com.google.api.grpc grpc-google-cloud-pubsub-v1 - 1.104.2 + 1.105.0 com.google.cloud google-cloud-pubsub - 1.122.2 + 1.123.0 diff --git a/proto-google-cloud-pubsub-v1/pom.xml b/proto-google-cloud-pubsub-v1/pom.xml index 5d49bb4b7..fdc78b825 100644 --- a/proto-google-cloud-pubsub-v1/pom.xml +++ b/proto-google-cloud-pubsub-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-pubsub-v1 - 1.104.2 + 1.105.0 proto-google-cloud-pubsub-v1 PROTO library for proto-google-cloud-pubsub-v1 com.google.cloud google-cloud-pubsub-parent - 1.122.2 + 1.123.0 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 index 5a0f1be23..8a84a3d74 100644 --- 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 @@ -389,8 +389,8 @@ public boolean getDropUnknownFields() { * * *
-   * Output only. An output-only field that indicates whether or not the subscription can
-   * receive messages.
+   * Output only. An output-only field that indicates whether or not the
+   * subscription can receive messages.
    * 
* * @@ -407,8 +407,8 @@ public int getStateValue() { * * *
-   * Output only. An output-only field that indicates whether or not the subscription can
-   * receive messages.
+   * Output only. An output-only field that indicates whether or not the
+   * subscription can receive messages.
    * 
* * @@ -1134,8 +1134,8 @@ public Builder clearDropUnknownFields() { * * *
-     * Output only. An output-only field that indicates whether or not the subscription can
-     * receive messages.
+     * Output only. An output-only field that indicates whether or not the
+     * subscription can receive messages.
      * 
* * @@ -1152,8 +1152,8 @@ public int getStateValue() { * * *
-     * Output only. An output-only field that indicates whether or not the subscription can
-     * receive messages.
+     * Output only. An output-only field that indicates whether or not the
+     * subscription can receive messages.
      * 
* * @@ -1173,8 +1173,8 @@ public Builder setStateValue(int value) { * * *
-     * Output only. An output-only field that indicates whether or not the subscription can
-     * receive messages.
+     * Output only. An output-only field that indicates whether or not the
+     * subscription can receive messages.
      * 
* * @@ -1194,8 +1194,8 @@ public com.google.pubsub.v1.BigQueryConfig.State getState() { * * *
-     * Output only. An output-only field that indicates whether or not the subscription can
-     * receive messages.
+     * Output only. An output-only field that indicates whether or not the
+     * subscription can receive messages.
      * 
* * @@ -1218,8 +1218,8 @@ public Builder setState(com.google.pubsub.v1.BigQueryConfig.State value) { * * *
-     * Output only. An output-only field that indicates whether or not the subscription can
-     * receive messages.
+     * Output only. An output-only field that indicates whether or not the
+     * subscription can receive messages.
      * 
* * 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 index 0b972a679..1a9275f08 100644 --- 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 @@ -102,8 +102,8 @@ public interface BigQueryConfigOrBuilder * * *
-   * Output only. An output-only field that indicates whether or not the subscription can
-   * receive messages.
+   * Output only. An output-only field that indicates whether or not the
+   * subscription can receive messages.
    * 
* * @@ -117,8 +117,8 @@ public interface BigQueryConfigOrBuilder * * *
-   * Output only. An output-only field that indicates whether or not the subscription can
-   * receive messages.
+   * Output only. An output-only field that indicates whether or not the
+   * subscription can receive messages.
    * 
* * 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 new file mode 100644 index 000000000..4e92ecefd --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequest.java @@ -0,0 +1,892 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for 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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + 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; + 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 getSchema(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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(); + name_ = ""; + + if (schemaBuilder_ == null) { + schema_ = null; + } else { + schema_ = null; + schemaBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_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); + result.name_ = name_; + if (schemaBuilder_ == null) { + result.schema_ = schema_; + } else { + result.schema_ = schemaBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.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_; + 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(); + + break; + } // case 10 + case 18: + { + input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); + + 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 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; + 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(); + 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; + 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 schemaBuilder_ != null || schema_ != null; + } + /** + * + * + *
+     * 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; + onChanged(); + } else { + schemaBuilder_.setMessage(value); + } + + 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(); + onChanged(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + + 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 (schema_ != null) { + schema_ = com.google.pubsub.v1.Schema.newBuilder(schema_).mergeFrom(value).buildPartial(); + } else { + schema_ = value; + } + onChanged(); + } else { + schemaBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The schema revision to commit.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearSchema() { + if (schemaBuilder_ == null) { + schema_ = null; + onChanged(); + } else { + schema_ = null; + schemaBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The schema revision to commit.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.pubsub.v1.Schema.Builder getSchemaBuilder() { + + onChanged(); + return getSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The schema 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 new file mode 100644 index 000000000..331bf5ae3 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequestOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface 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/DeleteSchemaRevisionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequest.java new file mode 100644 index 000000000..a6779112f --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequest.java @@ -0,0 +1,835 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the `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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + 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; + 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; + 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.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(); + 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); + result.name_ = name_; + result.revisionId_ = revisionId_; + 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.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_; + onChanged(); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + 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(); + + break; + } // case 10 + case 18: + { + revisionId_ = input.readStringRequireUtf8(); + + 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 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; + 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(); + 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; + 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; + 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(); + 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; + 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 new file mode 100644 index 000000000..28ded9ab4 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface 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(); + + /** + * + * + *
+   * 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/GetSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java index 68aa7ffaf..216c90343 100644 --- 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 @@ -130,8 +130,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
    * The set of fields to return in the response. If not set, returns a Schema
-   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-   * fields.
+   * with all fields filled out. Set to `BASIC` to omit the `definition`.
    * 
* * .google.pubsub.v1.SchemaView view = 2; @@ -147,8 +146,7 @@ public int getViewValue() { * *
    * The set of fields to return in the response. If not set, returns a Schema
-   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-   * fields.
+   * with all fields filled out. Set to `BASIC` to omit the `definition`.
    * 
* * .google.pubsub.v1.SchemaView view = 2; @@ -637,8 +635,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * *
      * The set of fields to return in the response. If not set, returns a Schema
-     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-     * fields.
+     * with all fields filled out. Set to `BASIC` to omit the `definition`.
      * 
* * .google.pubsub.v1.SchemaView view = 2; @@ -654,8 +651,7 @@ public int getViewValue() { * *
      * The set of fields to return in the response. If not set, returns a Schema
-     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-     * fields.
+     * with all fields filled out. Set to `BASIC` to omit the `definition`.
      * 
* * .google.pubsub.v1.SchemaView view = 2; @@ -674,8 +670,7 @@ public Builder setViewValue(int value) { * *
      * The set of fields to return in the response. If not set, returns a Schema
-     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-     * fields.
+     * with all fields filled out. Set to `BASIC` to omit the `definition`.
      * 
* * .google.pubsub.v1.SchemaView view = 2; @@ -693,8 +688,7 @@ public com.google.pubsub.v1.SchemaView getView() { * *
      * The set of fields to return in the response. If not set, returns a Schema
-     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-     * fields.
+     * with all fields filled out. Set to `BASIC` to omit the `definition`.
      * 
* * .google.pubsub.v1.SchemaView view = 2; @@ -716,8 +710,7 @@ public Builder setView(com.google.pubsub.v1.SchemaView value) { * *
      * The set of fields to return in the response. If not set, returns a Schema
-     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-     * fields.
+     * with all fields filled out. Set to `BASIC` to omit the `definition`.
      * 
* * .google.pubsub.v1.SchemaView view = 2; 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 index 54c9481e2..250f9dbad 100644 --- 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 @@ -59,8 +59,7 @@ public interface GetSchemaRequestOrBuilder * *
    * The set of fields to return in the response. If not set, returns a Schema
-   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-   * fields.
+   * with all fields filled out. Set to `BASIC` to omit the `definition`.
    * 
* * .google.pubsub.v1.SchemaView view = 2; @@ -73,8 +72,7 @@ public interface GetSchemaRequestOrBuilder * *
    * The set of fields to return in the response. If not set, returns a Schema
-   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
-   * fields.
+   * with all fields filled out. Set to `BASIC` to omit the `definition`.
    * 
* * .google.pubsub.v1.SchemaView view = 2; 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 new file mode 100644 index 000000000..2880af64a --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequest.java @@ -0,0 +1,1066 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the `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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + 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; + 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_; + /** + * + * + *
+   * The set of Schema fields to return in the response. If not set, returns
+   * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+   * retrieve all fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * The set of Schema fields to return in the response. If not set, returns
+   * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+   * retrieve all fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaView getView() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.valueOf(view_); + return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * 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; + 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(); + 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); + result.name_ = name_; + result.view_ = view_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.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_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.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(); + + break; + } // case 10 + case 16: + { + view_ = input.readEnum(); + + break; + } // case 16 + case 24: + { + pageSize_ = input.readInt32(); + + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + + 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 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; + 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(); + 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; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaView getView() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.valueOf(view_); + return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.pubsub.v1.SchemaView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of revisions to return per page.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + 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; + 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(); + 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; + 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 new file mode 100644 index 000000000..4d2c8f372 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface 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 new file mode 100644 index 000000000..417e71d01 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsResponse.java @@ -0,0 +1,1104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Response for the `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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + 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; + 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; + 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(); + 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); + int from_bitField0_ = bitField0_; + if (schemasBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + schemas_ = java.util.Collections.unmodifiableList(schemas_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.schemas_ = schemas_; + } else { + result.schemas_ = schemasBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.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_; + 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(); + + 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; + 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(); + 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; + 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 new file mode 100644 index 000000000..0ace05c42 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface 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/PubsubProto.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java index 509ddd3e4..40af0aaca 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java @@ -265,303 +265,304 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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\"t\n\016SchemaSettin" - + "gs\0224\n\006schema\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub.googl" - + "eapis.com/Schema\022,\n\010encoding\030\002 \001(\0162\032.goo" - + "gle.pubsub.v1.Encoding\"\303\003\n\005Topic\022\021\n\004name" - + "\030\001 \001(\tB\003\340A\002\0223\n\006labels\030\002 \003(\0132#.google.pub" - + "sub.v1.Topic.LabelsEntry\022F\n\026message_stor" - + "age_policy\030\003 \001(\0132&.google.pubsub.v1.Mess" - + "ageStoragePolicy\022\024\n\014kms_key_name\030\005 \001(\t\0229" - + "\n\017schema_settings\030\006 \001(\0132 .google.pubsub." - + "v1.SchemaSettings\022\025\n\rsatisfies_pzs\030\007 \001(\010" - + "\022=\n\032message_retention_duration\030\010 \001(\0132\031.g" - + "oogle.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\033pub" - + "sub.googleapis.com/Topic\022!projects/{proj" - + "ect}/topics/{topic}\022\017_deleted-topic_\"\361\001\n" - + "\rPubsubMessage\022\014\n\004data\030\001 \001(\014\022C\n\nattribut" - + "es\030\002 \003(\0132/.google.pubsub.v1.PubsubMessag" - + "e.AttributesEntry\022\022\n\nmessage_id\030\003 \001(\t\0220\n" - + "\014publish_time\030\004 \001(\0132\032.google.protobuf.Ti" - + "mestamp\022\024\n\014ordering_key\030\005 \001(\t\0321\n\017Attribu" - + "tesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" - + "\"E\n\017GetTopicRequest\0222\n\005topic\030\001 \001(\tB#\340A\002\372" - + "A\035\n\033pubsub.googleapis.com/Topic\"w\n\022Updat" - + "eTopicRequest\022+\n\005topic\030\001 \001(\0132\027.google.pu" - + "bsub.v1.TopicB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132" - + "\032.google.protobuf.FieldMaskB\003\340A\002\"|\n\016Publ" - + "ishRequest\0222\n\005topic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsu" - + "b.googleapis.com/Topic\0226\n\010messages\030\002 \003(\013" - + "2\037.google.pubsub.v1.PubsubMessageB\003\340A\002\"&" - + "\n\017PublishResponse\022\023\n\013message_ids\030\001 \003(\t\"\200" - + "\001\n\021ListTopicsRequest\022D\n\007project\030\001 \001(\tB3\340" - + "A\002\372A-\n+cloudresourcemanager.googleapis.c" - + "om/Project\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_to" - + "ken\030\003 \001(\t\"V\n\022ListTopicsResponse\022\'\n\006topic" - + "s\030\001 \003(\0132\027.google.pubsub.v1.Topic\022\027\n\017next" - + "_page_token\030\002 \001(\t\"z\n\035ListTopicSubscripti" - + "onsRequest\0222\n\005topic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsu" - + "b.googleapis.com/Topic\022\021\n\tpage_size\030\002 \001(" - + "\005\022\022\n\npage_token\030\003 \001(\t\"y\n\036ListTopicSubscr" - + "iptionsResponse\022>\n\rsubscriptions\030\001 \003(\tB\'" - + "\372A$\n\"pubsub.googleapis.com/Subscription\022" - + "\027\n\017next_page_token\030\002 \001(\t\"v\n\031ListTopicSna" - + "pshotsRequest\0222\n\005topic\030\001 \001(\tB#\340A\002\372A\035\n\033pu" - + "bsub.googleapis.com/Topic\022\021\n\tpage_size\030\002" - + " \001(\005\022\022\n\npage_token\030\003 \001(\t\"H\n\032ListTopicSna" - + "pshotsResponse\022\021\n\tsnapshots\030\001 \003(\t\022\027\n\017nex" - + "t_page_token\030\002 \001(\t\"H\n\022DeleteTopicRequest" - + "\0222\n\005topic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsub.googleap" - + "is.com/Topic\"]\n\031DetachSubscriptionReques" - + "t\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub." - + "googleapis.com/Subscription\"\034\n\032DetachSub" - + "scriptionResponse\"\345\007\n\014Subscription\022\021\n\004na" - + "me\030\001 \001(\tB\003\340A\002\0222\n\005topic\030\002 \001(\tB#\340A\002\372A\035\n\033pu" - + "bsub.googleapis.com/Topic\0221\n\013push_config" - + "\030\004 \001(\0132\034.google.pubsub.v1.PushConfig\0229\n\017" - + "bigquery_config\030\022 \001(\0132 .google.pubsub.v1" - + ".BigQueryConfig\022\034\n\024ack_deadline_seconds\030" - + "\005 \001(\005\022\035\n\025retain_acked_messages\030\007 \001(\010\022=\n\032" - + "message_retention_duration\030\010 \001(\0132\031.googl" - + "e.protobuf.Duration\022:\n\006labels\030\t \003(\0132*.go" - + "ogle.pubsub.v1.Subscription.LabelsEntry\022" - + "\037\n\027enable_message_ordering\030\n \001(\010\022=\n\021expi" - + "ration_policy\030\013 \001(\0132\".google.pubsub.v1.E" - + "xpirationPolicy\022\016\n\006filter\030\014 \001(\t\022>\n\022dead_" - + "letter_policy\030\r \001(\0132\".google.pubsub.v1.D" - + "eadLetterPolicy\0223\n\014retry_policy\030\016 \001(\0132\035." - + "google.pubsub.v1.RetryPolicy\022\020\n\010detached" - + "\030\017 \001(\010\022$\n\034enable_exactly_once_delivery\030\020" - + " \001(\010\022H\n topic_message_retention_duration" - + "\030\021 \001(\0132\031.google.protobuf.DurationB\003\340A\003\0228" - + "\n\005state\030\023 \001(\0162$.google.pubsub.v1.Subscri" - + "ption.StateB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001" - + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\">\n\005State\022\025\n\021STAT" - + "E_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\022\n\016RESOURCE_" - + "ERROR\020\002:X\352AU\n\"pubsub.googleapis.com/Subs" - + "cription\022/projects/{project}/subscriptio" - + "ns/{subscription}\"u\n\013RetryPolicy\0222\n\017mini" - + "mum_backoff\030\001 \001(\0132\031.google.protobuf.Dura" - + "tion\0222\n\017maximum_backoff\030\002 \001(\0132\031.google.p" - + "rotobuf.Duration\"L\n\020DeadLetterPolicy\022\031\n\021" - + "dead_letter_topic\030\001 \001(\t\022\035\n\025max_delivery_" - + "attempts\030\002 \001(\005\":\n\020ExpirationPolicy\022&\n\003tt" - + "l\030\001 \001(\0132\031.google.protobuf.Duration\"\255\002\n\nP" - + "ushConfig\022\025\n\rpush_endpoint\030\001 \001(\t\022@\n\nattr" - + "ibutes\030\002 \003(\0132,.google.pubsub.v1.PushConf" - + "ig.AttributesEntry\022<\n\noidc_token\030\003 \001(\0132&" - + ".google.pubsub.v1.PushConfig.OidcTokenH\000" - + "\032<\n\tOidcToken\022\035\n\025service_account_email\030\001" - + " \001(\t\022\020\n\010audience\030\002 \001(\t\0321\n\017AttributesEntr" - + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\027\n\025aut" - + "hentication_method\"\221\002\n\016BigQueryConfig\022\r\n" - + "\005table\030\001 \001(\t\022\030\n\020use_topic_schema\030\002 \001(\010\022\026" - + "\n\016write_metadata\030\003 \001(\010\022\033\n\023drop_unknown_f" - + "ields\030\004 \001(\010\022:\n\005state\030\005 \001(\0162&.google.pubs" - + "ub.v1.BigQueryConfig.StateB\003\340A\003\"e\n\005State" - + "\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\025\n\021P" - + "ERMISSION_DENIED\020\002\022\r\n\tNOT_FOUND\020\003\022\023\n\017SCH" - + "EMA_MISMATCH\020\004\"m\n\017ReceivedMessage\022\016\n\006ack" - + "_id\030\001 \001(\t\0220\n\007message\030\002 \001(\0132\037.google.pubs" - + "ub.v1.PubsubMessage\022\030\n\020delivery_attempt\030" - + "\003 \001(\005\"Z\n\026GetSubscriptionRequest\022@\n\014subsc" - + "ription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis" - + ".com/Subscription\"\214\001\n\031UpdateSubscription" - + "Request\0229\n\014subscription\030\001 \001(\0132\036.google.p" - + "ubsub.v1.SubscriptionB\003\340A\002\0224\n\013update_mas" - + "k\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002" - + "\"\207\001\n\030ListSubscriptionsRequest\022D\n\007project" - + "\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goo" - + "gleapis.com/Project\022\021\n\tpage_size\030\002 \001(\005\022\022" - + "\n\npage_token\030\003 \001(\t\"k\n\031ListSubscriptionsR" - + "esponse\0225\n\rsubscriptions\030\001 \003(\0132\036.google." - + "pubsub.v1.Subscription\022\027\n\017next_page_toke" - + "n\030\002 \001(\t\"]\n\031DeleteSubscriptionRequest\022@\n\014" - + "subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googl" - + "eapis.com/Subscription\"\223\001\n\027ModifyPushCon" - + "figRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$" - + "\n\"pubsub.googleapis.com/Subscription\0226\n\013" - + "push_config\030\002 \001(\0132\034.google.pubsub.v1.Pus" - + "hConfigB\003\340A\002\"\215\001\n\013PullRequest\022@\n\014subscrip" - + "tion\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.co" - + "m/Subscription\022!\n\022return_immediately\030\002 \001" - + "(\010B\005\030\001\340A\001\022\031\n\014max_messages\030\003 \001(\005B\003\340A\002\"L\n\014" - + "PullResponse\022<\n\021received_messages\030\001 \003(\0132" - + "!.google.pubsub.v1.ReceivedMessage\"\225\001\n\030M" - + "odifyAckDeadlineRequest\022@\n\014subscription\030" - + "\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/Sub" - + "scription\022\024\n\007ack_ids\030\004 \003(\tB\003\340A\002\022!\n\024ack_d" - + "eadline_seconds\030\003 \001(\005B\003\340A\002\"l\n\022Acknowledg" - + "eRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"" - + "pubsub.googleapis.com/Subscription\022\024\n\007ac" - + "k_ids\030\002 \003(\tB\003\340A\002\"\251\002\n\024StreamingPullReques" - + "t\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub." - + "googleapis.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_deadline_seconds\030\005 \001(\005B\003\340A\002\022\021\n\tclie" - + "nt_id\030\006 \001(\t\022 \n\030max_outstanding_messages\030" - + "\007 \001(\003\022\035\n\025max_outstanding_bytes\030\010 \001(\003\"\262\005\n" - + "\025StreamingPullResponse\022<\n\021received_messa" - + "ges\030\001 \003(\0132!.google.pubsub.v1.ReceivedMes" - + "sage\022a\n\030acknowledge_confirmation\030\005 \001(\0132?" - + ".google.pubsub.v1.StreamingPullResponse." - + "AcknowledgeConfirmation\022o\n modify_ack_de" - + "adline_confirmation\030\003 \001(\0132E.google.pubsu" - + "b.v1.StreamingPullResponse.ModifyAckDead" - + "lineConfirmation\022_\n\027subscription_propert" - + "ies\030\004 \001(\0132>.google.pubsub.v1.StreamingPu" - + "llResponse.SubscriptionProperties\032j\n\027Ack" - + "nowledgeConfirmation\022\023\n\007ack_ids\030\001 \003(\tB\002\010" - + "\001\022\033\n\017invalid_ack_ids\030\002 \003(\tB\002\010\001\022\035\n\021unorde" - + "red_ack_ids\030\003 \003(\tB\002\010\001\032Q\n\035ModifyAckDeadli" - + "neConfirmation\022\023\n\007ack_ids\030\001 \003(\tB\002\010\001\022\033\n\017i" - + "nvalid_ack_ids\030\002 \003(\tB\002\010\001\032a\n\026Subscription" - + "Properties\022%\n\035exactly_once_delivery_enab" - + "led\030\001 \001(\010\022 \n\030message_ordering_enabled\030\002 " - + "\001(\010J\004\010\002\020\003\"\203\002\n\025CreateSnapshotRequest\0224\n\004n" - + "ame\030\001 \001(\tB&\340A\002\372A \n\036pubsub.googleapis.com" - + "/Snapshot\022@\n\014subscription\030\002 \001(\tB*\340A\002\372A$\n" - + "\"pubsub.googleapis.com/Subscription\022C\n\006l" - + "abels\030\003 \003(\01323.google.pubsub.v1.CreateSna" - + "pshotRequest.LabelsEntry\032-\n\013LabelsEntry\022" - + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\200\001\n\025Upda" - + "teSnapshotRequest\0221\n\010snapshot\030\001 \001(\0132\032.go" - + "ogle.pubsub.v1.SnapshotB\003\340A\002\0224\n\013update_m" - + "ask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340" - + "A\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.Ti" - + "mestamp\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\036pub" - + "sub.googleapis.com/Snapshot\022\'projects/{p" - + "roject}/snapshots/{snapshot}\"N\n\022GetSnaps" - + "hotRequest\0228\n\010snapshot\030\001 \001(\tB&\340A\002\372A \n\036pu" - + "bsub.googleapis.com/Snapshot\"\203\001\n\024ListSna" - + "pshotsRequest\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+" - + "cloudresourcemanager.googleapis.com/Proj" - + "ect\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001" - + "(\t\"_\n\025ListSnapshotsResponse\022-\n\tsnapshots" - + "\030\001 \003(\0132\032.google.pubsub.v1.Snapshot\022\027\n\017ne" - + "xt_page_token\030\002 \001(\t\"Q\n\025DeleteSnapshotReq" + + "ersistence_regions\030\001 \003(\t\"\251\001\n\016SchemaSetti" + + "ngs\0224\n\006schema\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub.goog" + + "leapis.com/Schema\022,\n\010encoding\030\002 \001(\0162\032.go" + + "ogle.pubsub.v1.Encoding\022\031\n\021first_revisio" + + "n_id\030\003 \001(\t\022\030\n\020last_revision_id\030\004 \001(\t\"\303\003\n" + + "\005Topic\022\021\n\004name\030\001 \001(\tB\003\340A\002\0223\n\006labels\030\002 \003(" + + "\0132#.google.pubsub.v1.Topic.LabelsEntry\022F" + + "\n\026message_storage_policy\030\003 \001(\0132&.google." + + "pubsub.v1.MessageStoragePolicy\022\024\n\014kms_ke" + + "y_name\030\005 \001(\t\0229\n\017schema_settings\030\006 \001(\0132 ." + + "google.pubsub.v1.SchemaSettings\022\025\n\rsatis" + + "fies_pzs\030\007 \001(\010\022=\n\032message_retention_dura" + + "tion\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_dele" + + "ted-topic_\"\361\001\n\rPubsubMessage\022\014\n\004data\030\001 \001" + + "(\014\022C\n\nattributes\030\002 \003(\0132/.google.pubsub.v" + + "1.PubsubMessage.AttributesEntry\022\022\n\nmessa" + + "ge_id\030\003 \001(\t\0220\n\014publish_time\030\004 \001(\0132\032.goog" + + "le.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\005v" + + "alue\030\002 \001(\t:\0028\001\"E\n\017GetTopicRequest\0222\n\005top" + + "ic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/" + + "Topic\"w\n\022UpdateTopicRequest\022+\n\005topic\030\001 \001" + + "(\0132\027.google.pubsub.v1.TopicB\003\340A\002\0224\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "kB\003\340A\002\"|\n\016PublishRequest\0222\n\005topic\030\001 \001(\tB" + + "#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\0226\n\010" + + "messages\030\002 \003(\0132\037.google.pubsub.v1.Pubsub" + + "MessageB\003\340A\002\"&\n\017PublishResponse\022\023\n\013messa" + + "ge_ids\030\001 \003(\t\"\200\001\n\021ListTopicsRequest\022D\n\007pr" + + "oject\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanage" + + "r.googleapis.com/Project\022\021\n\tpage_size\030\002 " + + "\001(\005\022\022\n\npage_token\030\003 \001(\t\"V\n\022ListTopicsRes" + + "ponse\022\'\n\006topics\030\001 \003(\0132\027.google.pubsub.v1" + + ".Topic\022\027\n\017next_page_token\030\002 \001(\t\"z\n\035ListT" + + "opicSubscriptionsRequest\0222\n\005topic\030\001 \001(\tB" + + "#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\022\021\n\t" + + "page_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"y\n\036L" + + "istTopicSubscriptionsResponse\022>\n\rsubscri" + + "ptions\030\001 \003(\tB\'\372A$\n\"pubsub.googleapis.com" + + "/Subscription\022\027\n\017next_page_token\030\002 \001(\t\"v" + + "\n\031ListTopicSnapshotsRequest\0222\n\005topic\030\001 \001" + + "(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\022" + + "\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"H" + + "\n\032ListTopicSnapshotsResponse\022\021\n\tsnapshot" + + "s\030\001 \003(\t\022\027\n\017next_page_token\030\002 \001(\t\"H\n\022Dele" + + "teTopicRequest\0222\n\005topic\030\001 \001(\tB#\340A\002\372A\035\n\033p" + + "ubsub.googleapis.com/Topic\"]\n\031DetachSubs" + + "criptionRequest\022@\n\014subscription\030\001 \001(\tB*\340" + + "A\002\372A$\n\"pubsub.googleapis.com/Subscriptio" + + "n\"\034\n\032DetachSubscriptionResponse\"\345\007\n\014Subs" + + "cription\022\021\n\004name\030\001 \001(\tB\003\340A\002\0222\n\005topic\030\002 \001" + + "(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\022" + + "1\n\013push_config\030\004 \001(\0132\034.google.pubsub.v1." + + "PushConfig\0229\n\017bigquery_config\030\022 \001(\0132 .go" + + "ogle.pubsub.v1.BigQueryConfig\022\034\n\024ack_dea" + + "dline_seconds\030\005 \001(\005\022\035\n\025retain_acked_mess" + + "ages\030\007 \001(\010\022=\n\032message_retention_duration" + + "\030\010 \001(\0132\031.google.protobuf.Duration\022:\n\006lab" + + "els\030\t \003(\0132*.google.pubsub.v1.Subscriptio" + + "n.LabelsEntry\022\037\n\027enable_message_ordering" + + "\030\n \001(\010\022=\n\021expiration_policy\030\013 \001(\0132\".goog" + + "le.pubsub.v1.ExpirationPolicy\022\016\n\006filter\030" + + "\014 \001(\t\022>\n\022dead_letter_policy\030\r \001(\0132\".goog" + + "le.pubsub.v1.DeadLetterPolicy\0223\n\014retry_p" + + "olicy\030\016 \001(\0132\035.google.pubsub.v1.RetryPoli" + + "cy\022\020\n\010detached\030\017 \001(\010\022$\n\034enable_exactly_o" + + "nce_delivery\030\020 \001(\010\022H\n topic_message_rete" + + "ntion_duration\030\021 \001(\0132\031.google.protobuf.D" + + "urationB\003\340A\003\0228\n\005state\030\023 \001(\0162$.google.pub" + + "sub.v1.Subscription.StateB\003\340A\003\032-\n\013Labels" + + "Entry\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\006ACTIVE\020" + + "\001\022\022\n\016RESOURCE_ERROR\020\002:X\352AU\n\"pubsub.googl" + + "eapis.com/Subscription\022/projects/{projec" + + "t}/subscriptions/{subscription}\"u\n\013Retry" + + "Policy\0222\n\017minimum_backoff\030\001 \001(\0132\031.google" + + ".protobuf.Duration\0222\n\017maximum_backoff\030\002 " + + "\001(\0132\031.google.protobuf.Duration\"L\n\020DeadLe" + + "tterPolicy\022\031\n\021dead_letter_topic\030\001 \001(\t\022\035\n" + + "\025max_delivery_attempts\030\002 \001(\005\":\n\020Expirati" + + "onPolicy\022&\n\003ttl\030\001 \001(\0132\031.google.protobuf." + + "Duration\"\255\002\n\nPushConfig\022\025\n\rpush_endpoint" + + "\030\001 \001(\t\022@\n\nattributes\030\002 \003(\0132,.google.pubs" + + "ub.v1.PushConfig.AttributesEntry\022<\n\noidc" + + "_token\030\003 \001(\0132&.google.pubsub.v1.PushConf" + + "ig.OidcTokenH\000\032<\n\tOidcToken\022\035\n\025service_a" + + "ccount_email\030\001 \001(\t\022\020\n\010audience\030\002 \001(\t\0321\n\017" + + "AttributesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001B\027\n\025authentication_method\"\221\002\n\016Big" + + "QueryConfig\022\r\n\005table\030\001 \001(\t\022\030\n\020use_topic_" + + "schema\030\002 \001(\010\022\026\n\016write_metadata\030\003 \001(\010\022\033\n\023" + + "drop_unknown_fields\030\004 \001(\010\022:\n\005state\030\005 \001(\016" + + "2&.google.pubsub.v1.BigQueryConfig.State" + + "B\003\340A\003\"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\"m\n\017Received" + + "Message\022\016\n\006ack_id\030\001 \001(\t\0220\n\007message\030\002 \001(\013" + + "2\037.google.pubsub.v1.PubsubMessage\022\030\n\020del" + + "ivery_attempt\030\003 \001(\005\"Z\n\026GetSubscriptionRe" + + "quest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pub" + + "sub.googleapis.com/Subscription\"\214\001\n\031Upda" + + "teSubscriptionRequest\0229\n\014subscription\030\001 " + + "\001(\0132\036.google.pubsub.v1.SubscriptionB\003\340A\002" + + "\0224\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMaskB\003\340A\002\"\207\001\n\030ListSubscriptionsRequ" + + "est\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudresou" + + "rcemanager.googleapis.com/Project\022\021\n\tpag" + + "e_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"k\n\031List" + + "SubscriptionsResponse\0225\n\rsubscriptions\030\001" + + " \003(\0132\036.google.pubsub.v1.Subscription\022\027\n\017" + + "next_page_token\030\002 \001(\t\"]\n\031DeleteSubscript" + + "ionRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$" + + "\n\"pubsub.googleapis.com/Subscription\"\223\001\n" + + "\027ModifyPushConfigRequest\022@\n\014subscription" + + "\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/Su" + + "bscription\0226\n\013push_config\030\002 \001(\0132\034.google" + + ".pubsub.v1.PushConfigB\003\340A\002\"\215\001\n\013PullReque" + + "st\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub" + + ".googleapis.com/Subscription\022!\n\022return_i" + + "mmediately\030\002 \001(\010B\005\030\001\340A\001\022\031\n\014max_messages\030" + + "\003 \001(\005B\003\340A\002\"L\n\014PullResponse\022<\n\021received_m" + + "essages\030\001 \003(\0132!.google.pubsub.v1.Receive" + + "dMessage\"\225\001\n\030ModifyAckDeadlineRequest\022@\n" + + "\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.goog" + + "leapis.com/Subscription\022\024\n\007ack_ids\030\004 \003(\t" + + "B\003\340A\002\022!\n\024ack_deadline_seconds\030\003 \001(\005B\003\340A\002" + + "\"l\n\022AcknowledgeRequest\022@\n\014subscription\030\001" + + " \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/Subs" + + "cription\022\024\n\007ack_ids\030\002 \003(\tB\003\340A\002\"\251\002\n\024Strea" + + "mingPullRequest\022@\n\014subscription\030\001 \001(\tB*\340" + + "A\002\372A$\n\"pubsub.googleapis.com/Subscriptio" + + "n\022\017\n\007ack_ids\030\002 \003(\t\022\037\n\027modify_deadline_se" + + "conds\030\003 \003(\005\022\037\n\027modify_deadline_ack_ids\030\004" + + " \003(\t\022(\n\033stream_ack_deadline_seconds\030\005 \001(" + + "\005B\003\340A\002\022\021\n\tclient_id\030\006 \001(\t\022 \n\030max_outstan" + + "ding_messages\030\007 \001(\003\022\035\n\025max_outstanding_b" + + "ytes\030\010 \001(\003\"\236\005\n\025StreamingPullResponse\022<\n\021" + + "received_messages\030\001 \003(\0132!.google.pubsub." + + "v1.ReceivedMessage\022a\n\030acknowledge_confir" + + "mation\030\005 \001(\0132?.google.pubsub.v1.Streamin" + + "gPullResponse.AcknowledgeConfirmation\022o\n" + + " modify_ack_deadline_confirmation\030\003 \001(\0132" + + "E.google.pubsub.v1.StreamingPullResponse" + + ".ModifyAckDeadlineConfirmation\022_\n\027subscr" + + "iption_properties\030\004 \001(\0132>.google.pubsub." + + "v1.StreamingPullResponse.SubscriptionPro" + + "perties\032^\n\027AcknowledgeConfirmation\022\017\n\007ac" + + "k_ids\030\001 \003(\t\022\027\n\017invalid_ack_ids\030\002 \003(\t\022\031\n\021" + + "unordered_ack_ids\030\003 \003(\t\032I\n\035ModifyAckDead" + + "lineConfirmation\022\017\n\007ack_ids\030\001 \003(\t\022\027\n\017inv" + + "alid_ack_ids\030\002 \003(\t\032a\n\026SubscriptionProper" + + "ties\022%\n\035exactly_once_delivery_enabled\030\001 " + + "\001(\010\022 \n\030message_ordering_enabled\030\002 \001(\010J\004\010" + + "\002\020\003\"\203\002\n\025CreateSnapshotRequest\0224\n\004name\030\001 " + + "\001(\tB&\340A\002\372A \n\036pubsub.googleapis.com/Snaps" + + "hot\022@\n\014subscription\030\002 \001(\tB*\340A\002\372A$\n\"pubsu" + + "b.googleapis.com/Subscription\022C\n\006labels\030" + + "\003 \003(\01323.google.pubsub.v1.CreateSnapshotR" + + "equest.LabelsEntry\032-\n\013LabelsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\200\001\n\025UpdateSnap" + + "shotRequest\0221\n\010snapshot\030\001 \001(\0132\032.google.p" + + "ubsub.v1.SnapshotB\003\340A\002\0224\n\013update_mask\030\002 " + + "\001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"\257\002\n" + + "\010Snapshot\022\014\n\004name\030\001 \001(\t\022/\n\005topic\030\002 \001(\tB " + + "\372A\035\n\033pubsub.googleapis.com/Topic\022/\n\013expi" + + "re_time\030\003 \001(\0132\032.google.protobuf.Timestam" + + "p\0226\n\006labels\030\004 \003(\0132&.google.pubsub.v1.Sna" + + "pshot.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\036pubsub.go" + + "ogleapis.com/Snapshot\022\'projects/{project" + + "}/snapshots/{snapshot}\"N\n\022GetSnapshotReq" + "uest\0228\n\010snapshot\030\001 \001(\tB&\340A\002\372A \n\036pubsub.g" - + "oogleapis.com/Snapshot\"\276\001\n\013SeekRequest\022@" - + "\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.goo" - + "gleapis.com/Subscription\022*\n\004time\030\002 \001(\0132\032" - + ".google.protobuf.TimestampH\000\0227\n\010snapshot" - + "\030\003 \001(\tB#\372A \n\036pubsub.googleapis.com/Snaps" - + "hotH\000B\010\n\006target\"\016\n\014SeekResponse2\243\013\n\tPubl" - + "isher\022q\n\013CreateTopic\022\027.google.pubsub.v1." - + "Topic\032\027.google.pubsub.v1.Topic\"0\202\323\344\223\002#\032\036" - + "/v1/{name=projects/*/topics/*}:\001*\332A\004name" - + "\022}\n\013UpdateTopic\022$.google.pubsub.v1.Updat" - + "eTopicRequest\032\027.google.pubsub.v1.Topic\"/" - + "\202\323\344\223\002)2$/v1/{topic.name=projects/*/topic" - + "s/*}:\001*\022\223\001\n\007Publish\022 .google.pubsub.v1.P" - + "ublishRequest\032!.google.pubsub.v1.Publish" - + "Response\"C\202\323\344\223\002,\"\'/v1/{topic=projects/*/" - + "topics/*}:publish:\001*\332A\016topic,messages\022w\n" - + "\010GetTopic\022!.google.pubsub.v1.GetTopicReq" - + "uest\032\027.google.pubsub.v1.Topic\"/\202\323\344\223\002!\022\037/" - + "v1/{topic=projects/*/topics/*}\332A\005topic\022\212" - + "\001\n\nListTopics\022#.google.pubsub.v1.ListTop" - + "icsRequest\032$.google.pubsub.v1.ListTopics" - + "Response\"1\202\323\344\223\002!\022\037/v1/{project=projects/" - + "*}/topics\332A\007project\022\272\001\n\026ListTopicSubscri" - + "ptions\022/.google.pubsub.v1.ListTopicSubsc" - + "riptionsRequest\0320.google.pubsub.v1.ListT" - + "opicSubscriptionsResponse\"=\202\323\344\223\002/\022-/v1/{" - + "topic=projects/*/topics/*}/subscriptions" - + "\332A\005topic\022\252\001\n\022ListTopicSnapshots\022+.google" - + ".pubsub.v1.ListTopicSnapshotsRequest\032,.g" - + "oogle.pubsub.v1.ListTopicSnapshotsRespon" - + "se\"9\202\323\344\223\002+\022)/v1/{topic=projects/*/topics" - + "/*}/snapshots\332A\005topic\022|\n\013DeleteTopic\022$.g" - + "oogle.pubsub.v1.DeleteTopicRequest\032\026.goo" - + "gle.protobuf.Empty\"/\202\323\344\223\002!*\037/v1/{topic=p" - + "rojects/*/topics/*}\332A\005topic\022\255\001\n\022DetachSu" - + "bscription\022+.google.pubsub.v1.DetachSubs" - + "criptionRequest\032,.google.pubsub.v1.Detac" - + "hSubscriptionResponse\"<\202\323\344\223\0026\"4/v1/{subs" - + "cription=projects/*/subscriptions/*}:det" - + "ach\032p\312A\025pubsub.googleapis.com\322AUhttps://" - + "www.googleapis.com/auth/cloud-platform,h" - + "ttps://www.googleapis.com/auth/pubsub2\240\025" - + "\n\nSubscriber\022\264\001\n\022CreateSubscription\022\036.go" - + "ogle.pubsub.v1.Subscription\032\036.google.pub" - + "sub.v1.Subscription\"^\202\323\344\223\002*\032%/v1/{name=p" - + "rojects/*/subscriptions/*}:\001*\332A+name,top" - + "ic,push_config,ack_deadline_seconds\022\241\001\n\017" - + "GetSubscription\022(.google.pubsub.v1.GetSu" - + "bscriptionRequest\032\036.google.pubsub.v1.Sub" - + "scription\"D\202\323\344\223\002/\022-/v1/{subscription=pro" - + "jects/*/subscriptions/*}\332A\014subscription\022" - + "\240\001\n\022UpdateSubscription\022+.google.pubsub.v" - + "1.UpdateSubscriptionRequest\032\036.google.pub" - + "sub.v1.Subscription\"=\202\323\344\223\002722/v1/{subscr" - + "iption.name=projects/*/subscriptions/*}:" - + "\001*\022\246\001\n\021ListSubscriptions\022*.google.pubsub" - + ".v1.ListSubscriptionsRequest\032+.google.pu" - + "bsub.v1.ListSubscriptionsResponse\"8\202\323\344\223\002" - + "(\022&/v1/{project=projects/*}/subscription" - + "s\332A\007project\022\237\001\n\022DeleteSubscription\022+.goo" - + "gle.pubsub.v1.DeleteSubscriptionRequest\032" - + "\026.google.protobuf.Empty\"D\202\323\344\223\002/*-/v1/{su" - + "bscription=projects/*/subscriptions/*}\332A" - + "\014subscription\022\317\001\n\021ModifyAckDeadline\022*.go" - + "ogle.pubsub.v1.ModifyAckDeadlineRequest\032" - + "\026.google.protobuf.Empty\"v\202\323\344\223\002D\"?/v1/{su" - + "bscription=projects/*/subscriptions/*}:m" - + "odifyAckDeadline:\001*\332A)subscription,ack_i" - + "ds,ack_deadline_seconds\022\250\001\n\013Acknowledge\022" - + "$.google.pubsub.v1.AcknowledgeRequest\032\026." - + "google.protobuf.Empty\"[\202\323\344\223\002>\"9/v1/{subs" - + "cription=projects/*/subscriptions/*}:ack" - + "nowledge:\001*\332A\024subscription,ack_ids\022\320\001\n\004P" - + "ull\022\035.google.pubsub.v1.PullRequest\032\036.goo" - + "gle.pubsub.v1.PullResponse\"\210\001\202\323\344\223\0027\"2/v1" - + "/{subscription=projects/*/subscriptions/" - + "*}:pull:\001*\332A,subscription,return_immedia" - + "tely,max_messages\332A\031subscription,max_mes" - + "sages\022f\n\rStreamingPull\022&.google.pubsub.v" - + "1.StreamingPullRequest\032\'.google.pubsub.v" - + "1.StreamingPullResponse\"\000(\0010\001\022\273\001\n\020Modify" - + "PushConfig\022).google.pubsub.v1.ModifyPush" - + "ConfigRequest\032\026.google.protobuf.Empty\"d\202" - + "\323\344\223\002C\">/v1/{subscription=projects/*/subs" - + "criptions/*}:modifyPushConfig:\001*\332A\030subsc" - + "ription,push_config\022\211\001\n\013GetSnapshot\022$.go" - + "ogle.pubsub.v1.GetSnapshotRequest\032\032.goog" - + "le.pubsub.v1.Snapshot\"8\202\323\344\223\002\'\022%/v1/{snap" - + "shot=projects/*/snapshots/*}\332A\010snapshot\022" - + "\226\001\n\rListSnapshots\022&.google.pubsub.v1.Lis" - + "tSnapshotsRequest\032\'.google.pubsub.v1.Lis" - + "tSnapshotsResponse\"4\202\323\344\223\002$\022\"/v1/{project" - + "=projects/*}/snapshots\332A\007project\022\227\001\n\016Cre" - + "ateSnapshot\022\'.google.pubsub.v1.CreateSna" - + "pshotRequest\032\032.google.pubsub.v1.Snapshot" - + "\"@\202\323\344\223\002&\032!/v1/{name=projects/*/snapshots" - + "/*}:\001*\332A\021name,subscription\022\214\001\n\016UpdateSna" - + "pshot\022\'.google.pubsub.v1.UpdateSnapshotR" - + "equest\032\032.google.pubsub.v1.Snapshot\"5\202\323\344\223" - + "\002/2*/v1/{snapshot.name=projects/*/snapsh" - + "ots/*}:\001*\022\213\001\n\016DeleteSnapshot\022\'.google.pu" - + "bsub.v1.DeleteSnapshotRequest\032\026.google.p" - + "rotobuf.Empty\"8\202\323\344\223\002\'*%/v1/{snapshot=pro" - + "jects/*/snapshots/*}\332A\010snapshot\022\204\001\n\004Seek" - + "\022\035.google.pubsub.v1.SeekRequest\032\036.google" - + ".pubsub.v1.SeekResponse\"=\202\323\344\223\0027\"2/v1/{su" - + "bscription=projects/*/subscriptions/*}:s" - + "eek:\001*\032p\312A\025pubsub.googleapis.com\322AUhttps" - + "://www.googleapis.com/auth/cloud-platfor" - + "m,https://www.googleapis.com/auth/pubsub" - + "B\256\001\n\024com.google.pubsub.v1B\013PubsubProtoP\001" - + "Z6google.golang.org/genproto/googleapis/" - + "pubsub/v1;pubsub\370\001\001\252\002\026Google.Cloud.PubSu" - + "b.V1\312\002\026Google\\Cloud\\PubSub\\V1\352\002\031Google::" - + "Cloud::PubSub::V1b\006proto3" + + "oogleapis.com/Snapshot\"\203\001\n\024ListSnapshots" + + "Request\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudr" + + "esourcemanager.googleapis.com/Project\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"_\n\025" + + "ListSnapshotsResponse\022-\n\tsnapshots\030\001 \003(\013" + + "2\032.google.pubsub.v1.Snapshot\022\027\n\017next_pag" + + "e_token\030\002 \001(\t\"Q\n\025DeleteSnapshotRequest\0228" + + "\n\010snapshot\030\001 \001(\tB&\340A\002\372A \n\036pubsub.googlea" + + "pis.com/Snapshot\"\276\001\n\013SeekRequest\022@\n\014subs" + + "cription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapi" + + "s.com/Subscription\022*\n\004time\030\002 \001(\0132\032.googl" + + "e.protobuf.TimestampH\000\0227\n\010snapshot\030\003 \001(\t" + + "B#\372A \n\036pubsub.googleapis.com/SnapshotH\000B" + + "\010\n\006target\"\016\n\014SeekResponse2\243\013\n\tPublisher\022" + + "q\n\013CreateTopic\022\027.google.pubsub.v1.Topic\032" + + "\027.google.pubsub.v1.Topic\"0\202\323\344\223\002#\032\036/v1/{n" + + "ame=projects/*/topics/*}:\001*\332A\004name\022}\n\013Up" + + "dateTopic\022$.google.pubsub.v1.UpdateTopic" + + "Request\032\027.google.pubsub.v1.Topic\"/\202\323\344\223\002)" + + "2$/v1/{topic.name=projects/*/topics/*}:\001" + + "*\022\223\001\n\007Publish\022 .google.pubsub.v1.Publish" + + "Request\032!.google.pubsub.v1.PublishRespon" + + "se\"C\202\323\344\223\002,\"\'/v1/{topic=projects/*/topics" + + "/*}:publish:\001*\332A\016topic,messages\022w\n\010GetTo" + + "pic\022!.google.pubsub.v1.GetTopicRequest\032\027" + + ".google.pubsub.v1.Topic\"/\202\323\344\223\002!\022\037/v1/{to" + + "pic=projects/*/topics/*}\332A\005topic\022\212\001\n\nLis" + + "tTopics\022#.google.pubsub.v1.ListTopicsReq" + + "uest\032$.google.pubsub.v1.ListTopicsRespon" + + "se\"1\202\323\344\223\002!\022\037/v1/{project=projects/*}/top" + + "ics\332A\007project\022\272\001\n\026ListTopicSubscriptions" + + "\022/.google.pubsub.v1.ListTopicSubscriptio" + + "nsRequest\0320.google.pubsub.v1.ListTopicSu" + + "bscriptionsResponse\"=\202\323\344\223\002/\022-/v1/{topic=" + + "projects/*/topics/*}/subscriptions\332A\005top" + + "ic\022\252\001\n\022ListTopicSnapshots\022+.google.pubsu" + + "b.v1.ListTopicSnapshotsRequest\032,.google." + + "pubsub.v1.ListTopicSnapshotsResponse\"9\202\323" + + "\344\223\002+\022)/v1/{topic=projects/*/topics/*}/sn" + + "apshots\332A\005topic\022|\n\013DeleteTopic\022$.google." + + "pubsub.v1.DeleteTopicRequest\032\026.google.pr" + + "otobuf.Empty\"/\202\323\344\223\002!*\037/v1/{topic=project" + + "s/*/topics/*}\332A\005topic\022\255\001\n\022DetachSubscrip" + + "tion\022+.google.pubsub.v1.DetachSubscripti" + + "onRequest\032,.google.pubsub.v1.DetachSubsc" + + "riptionResponse\"<\202\323\344\223\0026\"4/v1/{subscripti" + + "on=projects/*/subscriptions/*}:detach\032p\312" + + "A\025pubsub.googleapis.com\322AUhttps://www.go" + + "ogleapis.com/auth/cloud-platform,https:/" + + "/www.googleapis.com/auth/pubsub2\240\025\n\nSubs" + + "criber\022\264\001\n\022CreateSubscription\022\036.google.p" + + "ubsub.v1.Subscription\032\036.google.pubsub.v1" + + ".Subscription\"^\202\323\344\223\002*\032%/v1/{name=project" + + "s/*/subscriptions/*}:\001*\332A+name,topic,pus" + + "h_config,ack_deadline_seconds\022\241\001\n\017GetSub" + + "scription\022(.google.pubsub.v1.GetSubscrip" + + "tionRequest\032\036.google.pubsub.v1.Subscript" + + "ion\"D\202\323\344\223\002/\022-/v1/{subscription=projects/" + + "*/subscriptions/*}\332A\014subscription\022\240\001\n\022Up" + + "dateSubscription\022+.google.pubsub.v1.Upda" + + "teSubscriptionRequest\032\036.google.pubsub.v1" + + ".Subscription\"=\202\323\344\223\002722/v1/{subscription" + + ".name=projects/*/subscriptions/*}:\001*\022\246\001\n" + + "\021ListSubscriptions\022*.google.pubsub.v1.Li" + + "stSubscriptionsRequest\032+.google.pubsub.v" + + "1.ListSubscriptionsResponse\"8\202\323\344\223\002(\022&/v1" + + "/{project=projects/*}/subscriptions\332A\007pr" + + "oject\022\237\001\n\022DeleteSubscription\022+.google.pu" + + "bsub.v1.DeleteSubscriptionRequest\032\026.goog" + + "le.protobuf.Empty\"D\202\323\344\223\002/*-/v1/{subscrip" + + "tion=projects/*/subscriptions/*}\332A\014subsc" + + "ription\022\317\001\n\021ModifyAckDeadline\022*.google.p" + + "ubsub.v1.ModifyAckDeadlineRequest\032\026.goog" + + "le.protobuf.Empty\"v\202\323\344\223\002D\"?/v1/{subscrip" + + "tion=projects/*/subscriptions/*}:modifyA" + + "ckDeadline:\001*\332A)subscription,ack_ids,ack" + + "_deadline_seconds\022\250\001\n\013Acknowledge\022$.goog" + + "le.pubsub.v1.AcknowledgeRequest\032\026.google" + + ".protobuf.Empty\"[\202\323\344\223\002>\"9/v1/{subscripti" + + "on=projects/*/subscriptions/*}:acknowled" + + "ge:\001*\332A\024subscription,ack_ids\022\320\001\n\004Pull\022\035." + + "google.pubsub.v1.PullRequest\032\036.google.pu" + + "bsub.v1.PullResponse\"\210\001\202\323\344\223\0027\"2/v1/{subs" + + "cription=projects/*/subscriptions/*}:pul" + + "l:\001*\332A,subscription,return_immediately,m" + + "ax_messages\332A\031subscription,max_messages\022" + + "f\n\rStreamingPull\022&.google.pubsub.v1.Stre" + + "amingPullRequest\032\'.google.pubsub.v1.Stre" + + "amingPullResponse\"\000(\0010\001\022\273\001\n\020ModifyPushCo" + + "nfig\022).google.pubsub.v1.ModifyPushConfig" + + "Request\032\026.google.protobuf.Empty\"d\202\323\344\223\002C\"" + + ">/v1/{subscription=projects/*/subscripti" + + "ons/*}:modifyPushConfig:\001*\332A\030subscriptio" + + "n,push_config\022\211\001\n\013GetSnapshot\022$.google.p" + + "ubsub.v1.GetSnapshotRequest\032\032.google.pub" + + "sub.v1.Snapshot\"8\202\323\344\223\002\'\022%/v1/{snapshot=p" + + "rojects/*/snapshots/*}\332A\010snapshot\022\226\001\n\rLi" + + "stSnapshots\022&.google.pubsub.v1.ListSnaps" + + "hotsRequest\032\'.google.pubsub.v1.ListSnaps" + + "hotsResponse\"4\202\323\344\223\002$\022\"/v1/{project=proje" + + "cts/*}/snapshots\332A\007project\022\227\001\n\016CreateSna" + + "pshot\022\'.google.pubsub.v1.CreateSnapshotR" + + "equest\032\032.google.pubsub.v1.Snapshot\"@\202\323\344\223" + + "\002&\032!/v1/{name=projects/*/snapshots/*}:\001*" + + "\332A\021name,subscription\022\214\001\n\016UpdateSnapshot\022" + + "\'.google.pubsub.v1.UpdateSnapshotRequest" + + "\032\032.google.pubsub.v1.Snapshot\"5\202\323\344\223\002/2*/v" + + "1/{snapshot.name=projects/*/snapshots/*}" + + ":\001*\022\213\001\n\016DeleteSnapshot\022\'.google.pubsub.v" + + "1.DeleteSnapshotRequest\032\026.google.protobu" + + "f.Empty\"8\202\323\344\223\002\'*%/v1/{snapshot=projects/" + + "*/snapshots/*}\332A\010snapshot\022\204\001\n\004Seek\022\035.goo" + + "gle.pubsub.v1.SeekRequest\032\036.google.pubsu" + + "b.v1.SeekResponse\"=\202\323\344\223\0027\"2/v1/{subscrip" + + "tion=projects/*/subscriptions/*}:seek:\001*" + + "\032p\312A\025pubsub.googleapis.com\322AUhttps://www" + + ".googleapis.com/auth/cloud-platform,http" + + "s://www.googleapis.com/auth/pubsubB\256\001\n\024c" + + "om.google.pubsub.v1B\013PubsubProtoP\001Z6goog" + + "le.golang.org/genproto/googleapis/pubsub" + + "/v1;pubsub\370\001\001\252\002\026Google.Cloud.PubSub.V1\312\002" + + "\026Google\\Cloud\\PubSub\\V1\352\002\031Google::Cloud:" + + ":PubSub::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -591,7 +592,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_SchemaSettings_descriptor, new java.lang.String[] { - "Schema", "Encoding", + "Schema", "Encoding", "FirstRevisionId", "LastRevisionId", }); internal_static_google_pubsub_v1_Topic_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_google_pubsub_v1_Topic_fieldAccessorTable = 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 index 1576416ee..8565ba78e 100644 --- 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 @@ -139,7 +139,7 @@ public com.google.protobuf.ByteString getSubscriptionBytes() { *
* * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1107 + * google/pubsub/v1/pubsub.proto;l=1117 * @return The returnImmediately. */ @java.lang.Override @@ -676,7 +676,7 @@ public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { *
* * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1107 + * google/pubsub/v1/pubsub.proto;l=1117 * @return The returnImmediately. */ @java.lang.Override @@ -702,7 +702,7 @@ public boolean getReturnImmediately() { *
* * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1107 + * google/pubsub/v1/pubsub.proto;l=1117 * @param value The returnImmediately to set. * @return This builder for chaining. */ @@ -731,7 +731,7 @@ public Builder setReturnImmediately(boolean value) { *
* * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1107 + * google/pubsub/v1/pubsub.proto;l=1117 * @return This builder for chaining. */ @java.lang.Deprecated 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 index 7c9a4f954..43814a655 100644 --- 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 @@ -71,7 +71,7 @@ public interface PullRequestOrBuilder *
* * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1107 + * google/pubsub/v1/pubsub.proto;l=1117 * @return The returnImmediately. */ @java.lang.Deprecated 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 new file mode 100644 index 000000000..f133b3c34 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequest.java @@ -0,0 +1,820 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the `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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + 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; + 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; + 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(); + 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); + result.name_ = name_; + result.revisionId_ = revisionId_; + 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.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_; + onChanged(); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + 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(); + + break; + } // case 10 + case 18: + { + revisionId_ = input.readStringRequireUtf8(); + + 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 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; + 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(); + 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; + 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; + 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(); + 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; + 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 new file mode 100644 index 000000000..4c5e776bc --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface 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 index bb7ac7757..ac2a12b5e 100644 --- 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 @@ -41,6 +41,7 @@ private Schema() { name_ = ""; type_ = 0; definition_ = ""; + revisionId_ = ""; } @java.lang.Override @@ -363,6 +364,113 @@ public com.google.protobuf.ByteString getDefinitionBytes() { } } + public static final int REVISION_ID_FIELD_NUMBER = 4; + 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 getRevisionCreateTime(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -386,6 +494,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io 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); } @@ -404,6 +518,12 @@ public int getSerializedSize() { 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; @@ -422,6 +542,11 @@ public boolean equals(final java.lang.Object 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; } @@ -439,6 +564,12 @@ public int hashCode() { 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; @@ -580,6 +711,14 @@ public Builder clear() { definition_ = ""; + revisionId_ = ""; + + if (revisionCreateTimeBuilder_ == null) { + revisionCreateTime_ = null; + } else { + revisionCreateTime_ = null; + revisionCreateTimeBuilder_ = null; + } return this; } @@ -608,6 +747,12 @@ public com.google.pubsub.v1.Schema buildPartial() { result.name_ = name_; result.type_ = type_; result.definition_ = definition_; + result.revisionId_ = revisionId_; + if (revisionCreateTimeBuilder_ == null) { + result.revisionCreateTime_ = revisionCreateTime_; + } else { + result.revisionCreateTime_ = revisionCreateTimeBuilder_.build(); + } onBuilt(); return result; } @@ -668,6 +813,13 @@ public Builder mergeFrom(com.google.pubsub.v1.Schema other) { definition_ = other.definition_; onChanged(); } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + onChanged(); + } + if (other.hasRevisionCreateTime()) { + mergeRevisionCreateTime(other.getRevisionCreateTime()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -712,6 +864,19 @@ public Builder mergeFrom( break; } // case 26 + case 34: + { + revisionId_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 50: + { + input.readMessage( + getRevisionCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1046,6 +1211,325 @@ public Builder setDefinitionBytes(com.google.protobuf.ByteString value) { 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; + 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(); + 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; + 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 revisionCreateTimeBuilder_ != null || 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. + */ + 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; + onChanged(); + } else { + revisionCreateTimeBuilder_.setMessage(value); + } + + 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(); + onChanged(); + } else { + revisionCreateTimeBuilder_.setMessage(builderForValue.build()); + } + + 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 (revisionCreateTime_ != null) { + revisionCreateTime_ = + com.google.protobuf.Timestamp.newBuilder(revisionCreateTime_) + .mergeFrom(value) + .buildPartial(); + } else { + revisionCreateTime_ = value; + } + onChanged(); + } else { + revisionCreateTimeBuilder_.mergeFrom(value); + } + + 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() { + if (revisionCreateTimeBuilder_ == null) { + revisionCreateTime_ = null; + onChanged(); + } else { + revisionCreateTime_ = null; + revisionCreateTimeBuilder_ = null; + } + + 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() { + + 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); 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 index 30c88d8aa..34ad87bb7 100644 --- 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 @@ -103,4 +103,74 @@ public interface SchemaOrBuilder * @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 index f692cb891..2a4147c0f 100644 --- 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 @@ -47,6 +47,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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 @@ -80,73 +100,107 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pubsub.v1\032\034google/api/annotations.proto\032" + "\027google/api/client.proto\032\037google/api/fie" + "ld_behavior.proto\032\031google/api/resource.p" - + "roto\032\033google/protobuf/empty.proto\"\341\001\n\006Sc" - + "hema\022\021\n\004name\030\001 \001(\tB\003\340A\002\022+\n\004type\030\002 \001(\0162\035." - + "google.pubsub.v1.Schema.Type\022\022\n\ndefiniti" - + "on\030\003 \001(\t\";\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\023" - + "\n\017PROTOCOL_BUFFER\020\001\022\010\n\004AVRO\020\002:F\352AC\n\034pubs" - + "ub.googleapis.com/Schema\022#projects/{proj" - + "ect}/schemas/{schema}\"\215\001\n\023CreateSchemaRe" - + "quest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\022\034pubsub.go" - + "ogleapis.com/Schema\022-\n\006schema\030\002 \001(\0132\030.go" - + "ogle.pubsub.v1.SchemaB\003\340A\002\022\021\n\tschema_id\030" - + "\003 \001(\t\"r\n\020GetSchemaRequest\0222\n\004name\030\001 \001(\tB" - + "$\340A\002\372A\036\n\034pubsub.googleapis.com/Schema\022*\n" - + "\004view\030\002 \001(\0162\034.google.pubsub.v1.SchemaVie" - + "w\"\254\001\n\022ListSchemasRequest\022C\n\006parent\030\001 \001(\t" - + "B3\340A\002\372A-\n+cloudresourcemanager.googleapi" - + "s.com/Project\022*\n\004view\030\002 \001(\0162\034.google.pub" - + "sub.v1.SchemaView\022\021\n\tpage_size\030\003 \001(\005\022\022\n\n" - + "page_token\030\004 \001(\t\"Y\n\023ListSchemasResponse\022" - + ")\n\007schemas\030\001 \003(\0132\030.google.pubsub.v1.Sche" - + "ma\022\027\n\017next_page_token\030\002 \001(\t\"I\n\023DeleteSch" - + "emaRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub" - + ".googleapis.com/Schema\"\213\001\n\025ValidateSchem" - + "aRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudr" - + "esourcemanager.googleapis.com/Project\022-\n" - + "\006schema\030\002 \001(\0132\030.google.pubsub.v1.SchemaB" - + "\003\340A\002\"\030\n\026ValidateSchemaResponse\"\212\002\n\026Valid" - + "ateMessageRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A" - + "-\n+cloudresourcemanager.googleapis.com/P" - + "roject\0221\n\004name\030\002 \001(\tB!\372A\036\n\034pubsub.google" - + "apis.com/SchemaH\000\022*\n\006schema\030\003 \001(\0132\030.goog" - + "le.pubsub.v1.SchemaH\000\022\017\n\007message\030\004 \001(\014\022," - + "\n\010encoding\030\005 \001(\0162\032.google.pubsub.v1.Enco" - + "dingB\r\n\013schema_spec\"\031\n\027ValidateMessageRe" - + "sponse*>\n\nSchemaView\022\033\n\027SCHEMA_VIEW_UNSP" - + "ECIFIED\020\000\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\002*:\n\010Encodi" - + "ng\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\010\n\004JSON\020\001\022\n" - + "\n\006BINARY\020\0022\367\007\n\rSchemaService\022\232\001\n\014CreateS" - + "chema\022%.google.pubsub.v1.CreateSchemaReq" - + "uest\032\030.google.pubsub.v1.Schema\"I\202\323\344\223\002)\"\037" - + "/v1/{parent=projects/*}/schemas:\006schema\332" - + "A\027parent,schema,schema_id\022y\n\tGetSchema\022\"" - + ".google.pubsub.v1.GetSchemaRequest\032\030.goo" - + "gle.pubsub.v1.Schema\".\202\323\344\223\002!\022\037/v1/{name=" - + "projects/*/schemas/*}\332A\004name\022\214\001\n\013ListSch" - + "emas\022$.google.pubsub.v1.ListSchemasReque" - + "st\032%.google.pubsub.v1.ListSchemasRespons" - + "e\"0\202\323\344\223\002!\022\037/v1/{parent=projects/*}/schem" - + "as\332A\006parent\022}\n\014DeleteSchema\022%.google.pub" - + "sub.v1.DeleteSchemaRequest\032\026.google.prot" - + "obuf.Empty\".\202\323\344\223\002!*\037/v1/{name=projects/*" - + "/schemas/*}\332A\004name\022\250\001\n\016ValidateSchema\022\'." - + "google.pubsub.v1.ValidateSchemaRequest\032(" - + ".google.pubsub.v1.ValidateSchemaResponse" - + "\"C\202\323\344\223\002-\"(/v1/{parent=projects/*}/schema" - + "s:validate:\001*\332A\rparent,schema\022\242\001\n\017Valida" - + "teMessage\022(.google.pubsub.v1.ValidateMes" - + "sageRequest\032).google.pubsub.v1.ValidateM" - + "essageResponse\":\202\323\344\223\0024\"//v1/{parent=proj" - + "ects/*}/schemas:validateMessage:\001*\032p\312A\025p" - + "ubsub.googleapis.com\322AUhttps://www.googl" - + "eapis.com/auth/cloud-platform,https://ww" - + "w.googleapis.com/auth/pubsubB\256\001\n\024com.goo" - + "gle.pubsub.v1B\013SchemaProtoP\001Z6google.gol" - + "ang.org/genproto/googleapis/pubsub/v1;pu" - + "bsub\370\001\001\252\002\026Google.Cloud.PubSub.V1\312\002\026Googl" - + "e\\Cloud\\PubSub\\V1\352\002\031Google::Cloud::PubSu" - + "b::V1b\006proto3" + + "roto\032\033google/protobuf/empty.proto\032\037googl" + + "e/protobuf/timestamp.proto\"\275\002\n\006Schema\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022+\n\004type\030\002 \001(\0162\035.google." + + "pubsub.v1.Schema.Type\022\022\n\ndefinition\030\003 \001(" + + "\t\022\033\n\013revision_id\030\004 \001(\tB\006\340A\005\340A\003\022=\n\024revisi" + + "on_create_time\030\006 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\";\n\004Type\022\024\n\020TYPE_UNSPECIFIE" + + "D\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}\"\215\001\n\023CreateSch" + + "emaRequest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\022\034pubs" + + "ub.googleapis.com/Schema\022-\n\006schema\030\002 \001(\013" + + "2\030.google.pubsub.v1.SchemaB\003\340A\002\022\021\n\tschem" + + "a_id\030\003 \001(\t\"r\n\020GetSchemaRequest\0222\n\004name\030\001" + + " \001(\tB$\340A\002\372A\036\n\034pubsub.googleapis.com/Sche" + + "ma\022*\n\004view\030\002 \001(\0162\034.google.pubsub.v1.Sche" + + "maView\"\254\001\n\022ListSchemasRequest\022C\n\006parent\030" + + "\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goog" + + "leapis.com/Project\022*\n\004view\030\002 \001(\0162\034.googl" + + "e.pubsub.v1.SchemaView\022\021\n\tpage_size\030\003 \001(" + + "\005\022\022\n\npage_token\030\004 \001(\t\"Y\n\023ListSchemasResp" + + "onse\022)\n\007schemas\030\001 \003(\0132\030.google.pubsub.v1" + + ".Schema\022\027\n\017next_page_token\030\002 \001(\t\"\243\001\n\032Lis" + + "tSchemaRevisionsRequest\0222\n\004name\030\001 \001(\tB$\340" + + "A\002\372A\036\n\034pubsub.googleapis.com/Schema\022*\n\004v" + + "iew\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\"a" + + "\n\033ListSchemaRevisionsResponse\022)\n\007schemas" + + "\030\001 \003(\0132\030.google.pubsub.v1.Schema\022\027\n\017next" + + "_page_token\030\002 \001(\t\"x\n\023CommitSchemaRequest" + + "\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub.googleapi" + + "s.com/Schema\022-\n\006schema\030\002 \001(\0132\030.google.pu" + + "bsub.v1.SchemaB\003\340A\002\"e\n\025RollbackSchemaReq" + + "uest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub.googl" + + "eapis.com/Schema\022\030\n\013revision_id\030\002 \001(\tB\003\340" + + "A\002\"k\n\033DeleteSchemaRevisionRequest\0222\n\004nam" + + "e\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub.googleapis.com/S" + + "chema\022\030\n\013revision_id\030\002 \001(\tB\003\340A\002\"I\n\023Delet" + + "eSchemaRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034pu" + + "bsub.googleapis.com/Schema\"\213\001\n\025ValidateS" + + "chemaRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cl" + + "oudresourcemanager.googleapis.com/Projec" + + "t\022-\n\006schema\030\002 \001(\0132\030.google.pubsub.v1.Sch" + + "emaB\003\340A\002\"\030\n\026ValidateSchemaResponse\"\212\002\n\026V" + + "alidateMessageRequest\022C\n\006parent\030\001 \001(\tB3\340" + + "A\002\372A-\n+cloudresourcemanager.googleapis.c" + + "om/Project\0221\n\004name\030\002 \001(\tB!\372A\036\n\034pubsub.go" + + "ogleapis.com/SchemaH\000\022*\n\006schema\030\003 \001(\0132\030." + + "google.pubsub.v1.SchemaH\000\022\017\n\007message\030\004 \001" + + "(\014\022,\n\010encoding\030\005 \001(\0162\032.google.pubsub.v1." + + "EncodingB\r\n\013schema_spec\"\031\n\027ValidateMessa" + + "geResponse*>\n\nSchemaView\022\033\n\027SCHEMA_VIEW_" + + "UNSPECIFIED\020\000\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\002*:\n\010En" + + "coding\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\010\n\004JSON" + + "\020\001\022\n\n\006BINARY\020\0022\210\r\n\rSchemaService\022\232\001\n\014Cre" + + "ateSchema\022%.google.pubsub.v1.CreateSchem" + + "aRequest\032\030.google.pubsub.v1.Schema\"I\202\323\344\223" + + "\002)\"\037/v1/{parent=projects/*}/schemas:\006sch" + + "ema\332A\027parent,schema,schema_id\022y\n\tGetSche" + + "ma\022\".google.pubsub.v1.GetSchemaRequest\032\030" + + ".google.pubsub.v1.Schema\".\202\323\344\223\002!\022\037/v1/{n" + + "ame=projects/*/schemas/*}\332A\004name\022\214\001\n\013Lis" + + "tSchemas\022$.google.pubsub.v1.ListSchemasR" + + "equest\032%.google.pubsub.v1.ListSchemasRes" + + "ponse\"0\202\323\344\223\002!\022\037/v1/{parent=projects/*}/s" + + "chemas\332A\006parent\022\260\001\n\023ListSchemaRevisions\022" + + ",.google.pubsub.v1.ListSchemaRevisionsRe" + + "quest\032-.google.pubsub.v1.ListSchemaRevis" + + "ionsResponse\"<\202\323\344\223\002/\022-/v1/{name=projects" + + "/*/schemas/*}:listRevisions\332A\004name\022\220\001\n\014C" + + "ommitSchema\022%.google.pubsub.v1.CommitSch" + + "emaRequest\032\030.google.pubsub.v1.Schema\"?\202\323" + + "\344\223\002+\"&/v1/{name=projects/*/schemas/*}:co" + + "mmit:\001*\332A\013name,schema\022\233\001\n\016RollbackSchema" + + "\022\'.google.pubsub.v1.RollbackSchemaReques" + + "t\032\030.google.pubsub.v1.Schema\"F\202\323\344\223\002-\"(/v1" + + "/{name=projects/*/schemas/*}:rollback:\001*" + + "\332A\020name,revision_id\022\252\001\n\024DeleteSchemaRevi" + + "sion\022-.google.pubsub.v1.DeleteSchemaRevi" + + "sionRequest\032\030.google.pubsub.v1.Schema\"I\202" + + "\323\344\223\0020*./v1/{name=projects/*/schemas/*}:d" + + "eleteRevision\332A\020name,revision_id\022}\n\014Dele" + + "teSchema\022%.google.pubsub.v1.DeleteSchema" + + "Request\032\026.google.protobuf.Empty\".\202\323\344\223\002!*" + + "\037/v1/{name=projects/*/schemas/*}\332A\004name\022" + + "\250\001\n\016ValidateSchema\022\'.google.pubsub.v1.Va" + + "lidateSchemaRequest\032(.google.pubsub.v1.V" + + "alidateSchemaResponse\"C\202\323\344\223\002-\"(/v1/{pare" + + "nt=projects/*}/schemas:validate:\001*\332A\rpar" + + "ent,schema\022\242\001\n\017ValidateMessage\022(.google." + + "pubsub.v1.ValidateMessageRequest\032).googl" + + "e.pubsub.v1.ValidateMessageResponse\":\202\323\344" + + "\223\0024\"//v1/{parent=projects/*}/schemas:val" + + "idateMessage:\001*\032p\312A\025pubsub.googleapis.co" + + "m\322AUhttps://www.googleapis.com/auth/clou" + + "d-platform,https://www.googleapis.com/au" + + "th/pubsubB\256\001\n\024com.google.pubsub.v1B\013Sche" + + "maProtoP\001Z6google.golang.org/genproto/go" + + "ogleapis/pubsub/v1;pubsub\370\001\001\252\002\026Google.Cl" + + "oud.PubSub.V1\312\002\026Google\\Cloud\\PubSub\\V1\352\002" + + "\031Google::Cloud::PubSub::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -157,13 +211,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor 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", + "Name", "Type", "Definition", "RevisionId", "RevisionCreateTime", }); internal_static_google_pubsub_v1_CreateSchemaRequest_descriptor = getDescriptor().getMessageTypes().get(1); @@ -197,8 +252,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Schemas", "NextPageToken", }); - internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor = + 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, @@ -206,7 +301,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(11); internal_static_google_pubsub_v1_ValidateSchemaRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor, @@ -214,13 +309,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Schema", }); internal_static_google_pubsub_v1_ValidateSchemaResponse_descriptor = - getDescriptor().getMessageTypes().get(7); + 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(8); + getDescriptor().getMessageTypes().get(13); internal_static_google_pubsub_v1_ValidateMessageRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ValidateMessageRequest_descriptor, @@ -228,7 +323,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Name", "Schema", "Message", "Encoding", "SchemaSpec", }); internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(14); internal_static_google_pubsub_v1_ValidateMessageResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor, @@ -249,6 +344,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor 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 index a7174f367..c618f10d6 100644 --- 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 @@ -40,6 +40,8 @@ private SchemaSettings(com.google.protobuf.GeneratedMessageV3.Builder builder private SchemaSettings() { schema_ = ""; encoding_ = 0; + firstRevisionId_ = ""; + lastRevisionId_ = ""; } @java.lang.Override @@ -162,6 +164,112 @@ public com.google.pubsub.v1.Encoding getEncoding() { return result == null ? com.google.pubsub.v1.Encoding.UNRECOGNIZED : result; } + public static final int FIRST_REVISION_ID_FIELD_NUMBER = 3; + 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; + 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 @@ -182,6 +290,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io 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); } @@ -197,6 +311,12 @@ public int getSerializedSize() { 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; @@ -214,6 +334,8 @@ public boolean equals(final java.lang.Object 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; } @@ -229,6 +351,10 @@ public int hashCode() { 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; @@ -370,6 +496,10 @@ public Builder clear() { encoding_ = 0; + firstRevisionId_ = ""; + + lastRevisionId_ = ""; + return this; } @@ -398,6 +528,8 @@ public com.google.pubsub.v1.SchemaSettings buildPartial() { com.google.pubsub.v1.SchemaSettings result = new com.google.pubsub.v1.SchemaSettings(this); result.schema_ = schema_; result.encoding_ = encoding_; + result.firstRevisionId_ = firstRevisionId_; + result.lastRevisionId_ = lastRevisionId_; onBuilt(); return result; } @@ -454,6 +586,14 @@ public Builder mergeFrom(com.google.pubsub.v1.SchemaSettings other) { if (other.encoding_ != 0) { setEncodingValue(other.getEncodingValue()); } + if (!other.getFirstRevisionId().isEmpty()) { + firstRevisionId_ = other.firstRevisionId_; + onChanged(); + } + if (!other.getLastRevisionId().isEmpty()) { + lastRevisionId_ = other.lastRevisionId_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -492,6 +632,18 @@ public Builder mergeFrom( break; } // case 16 + case 26: + { + firstRevisionId_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + lastRevisionId_ = input.readStringRequireUtf8(); + + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -730,6 +882,238 @@ public Builder clearEncoding() { 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; + 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(); + 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; + 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; + 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(); + 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; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettingsOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettingsOrBuilder.java index f44178d47..6fad23f77 100644 --- 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 @@ -82,4 +82,62 @@ public interface SchemaSettingsOrBuilder * @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/StreamingPullResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullResponse.java index a7ef508cb..5203cb412 100644 --- 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 @@ -80,7 +80,7 @@ public interface AcknowledgeConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return A list containing the ackIds. */ @@ -92,7 +92,7 @@ public interface AcknowledgeConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return The count of ackIds. */ @@ -104,7 +104,7 @@ public interface AcknowledgeConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the element to return. * @return The ackIds at the given index. @@ -117,7 +117,7 @@ public interface AcknowledgeConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the value to return. * @return The bytes of the ackIds at the given index. @@ -132,7 +132,7 @@ public interface AcknowledgeConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return A list containing the invalidAckIds. */ @@ -145,7 +145,7 @@ public interface AcknowledgeConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return The count of invalidAckIds. */ @@ -158,7 +158,7 @@ public interface AcknowledgeConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index of the element to return. * @return The invalidAckIds at the given index. @@ -172,7 +172,7 @@ public interface AcknowledgeConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * 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. @@ -186,7 +186,7 @@ public interface AcknowledgeConfirmationOrBuilder * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @return A list containing the unorderedAckIds. */ @@ -198,7 +198,7 @@ public interface AcknowledgeConfirmationOrBuilder * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @return The count of unorderedAckIds. */ @@ -210,7 +210,7 @@ public interface AcknowledgeConfirmationOrBuilder * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @param index The index of the element to return. * @return The unorderedAckIds at the given index. @@ -223,7 +223,7 @@ public interface AcknowledgeConfirmationOrBuilder * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * 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. @@ -291,7 +291,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return A list containing the ackIds. */ @@ -305,7 +305,7 @@ public com.google.protobuf.ProtocolStringList getAckIdsList() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return The count of ackIds. */ @@ -319,7 +319,7 @@ public int getAckIdsCount() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the element to return. * @return The ackIds at the given index. @@ -334,7 +334,7 @@ public java.lang.String getAckIds(int index) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the value to return. * @return The bytes of the ackIds at the given index. @@ -353,7 +353,7 @@ public com.google.protobuf.ByteString getAckIdsBytes(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return A list containing the invalidAckIds. */ @@ -368,7 +368,7 @@ public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return The count of invalidAckIds. */ @@ -383,7 +383,7 @@ public int getInvalidAckIdsCount() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index of the element to return. * @return The invalidAckIds at the given index. @@ -399,7 +399,7 @@ public java.lang.String getInvalidAckIds(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * 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. @@ -417,7 +417,7 @@ public com.google.protobuf.ByteString getInvalidAckIdsBytes(int index) { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @return A list containing the unorderedAckIds. */ @@ -431,7 +431,7 @@ public com.google.protobuf.ProtocolStringList getUnorderedAckIdsList() { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @return The count of unorderedAckIds. */ @@ -445,7 +445,7 @@ public int getUnorderedAckIdsCount() { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @param index The index of the element to return. * @return The unorderedAckIds at the given index. @@ -460,7 +460,7 @@ public java.lang.String getUnorderedAckIds(int index) { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * 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. @@ -929,7 +929,7 @@ private void ensureAckIdsIsMutable() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return A list containing the ackIds. */ @@ -943,7 +943,7 @@ public com.google.protobuf.ProtocolStringList getAckIdsList() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return The count of ackIds. */ @@ -957,7 +957,7 @@ public int getAckIdsCount() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the element to return. * @return The ackIds at the given index. @@ -972,7 +972,7 @@ public java.lang.String getAckIds(int index) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the value to return. * @return The bytes of the ackIds at the given index. @@ -987,7 +987,7 @@ public com.google.protobuf.ByteString getAckIdsBytes(int index) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index to set the value at. * @param value The ackIds to set. @@ -1009,7 +1009,7 @@ public Builder setAckIds(int index, java.lang.String value) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param value The ackIds to add. * @return This builder for chaining. @@ -1030,7 +1030,7 @@ public Builder addAckIds(java.lang.String value) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param values The ackIds to add. * @return This builder for chaining. @@ -1048,7 +1048,7 @@ public Builder addAllAckIds(java.lang.Iterable values) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return This builder for chaining. */ @@ -1065,7 +1065,7 @@ public Builder clearAckIds() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param value The bytes of the ackIds to add. * @return This builder for chaining. @@ -1098,7 +1098,7 @@ private void ensureInvalidAckIdsIsMutable() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return A list containing the invalidAckIds. */ @@ -1113,7 +1113,7 @@ public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return The count of invalidAckIds. */ @@ -1128,7 +1128,7 @@ public int getInvalidAckIdsCount() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index of the element to return. * @return The invalidAckIds at the given index. @@ -1144,7 +1144,7 @@ public java.lang.String getInvalidAckIds(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * 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. @@ -1160,7 +1160,7 @@ public com.google.protobuf.ByteString getInvalidAckIdsBytes(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index to set the value at. * @param value The invalidAckIds to set. @@ -1183,7 +1183,7 @@ public Builder setInvalidAckIds(int index, java.lang.String value) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param value The invalidAckIds to add. * @return This builder for chaining. @@ -1205,7 +1205,7 @@ public Builder addInvalidAckIds(java.lang.String value) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param values The invalidAckIds to add. * @return This builder for chaining. @@ -1224,7 +1224,7 @@ public Builder addAllInvalidAckIds(java.lang.Iterable values) * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return This builder for chaining. */ @@ -1242,7 +1242,7 @@ public Builder clearInvalidAckIds() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param value The bytes of the invalidAckIds to add. * @return This builder for chaining. @@ -1274,7 +1274,7 @@ private void ensureUnorderedAckIdsIsMutable() { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @return A list containing the unorderedAckIds. */ @@ -1288,7 +1288,7 @@ public com.google.protobuf.ProtocolStringList getUnorderedAckIdsList() { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @return The count of unorderedAckIds. */ @@ -1302,7 +1302,7 @@ public int getUnorderedAckIdsCount() { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @param index The index of the element to return. * @return The unorderedAckIds at the given index. @@ -1317,7 +1317,7 @@ public java.lang.String getUnorderedAckIds(int index) { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * 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. @@ -1332,7 +1332,7 @@ public com.google.protobuf.ByteString getUnorderedAckIdsBytes(int index) { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @param index The index to set the value at. * @param value The unorderedAckIds to set. @@ -1354,7 +1354,7 @@ public Builder setUnorderedAckIds(int index, java.lang.String value) { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @param value The unorderedAckIds to add. * @return This builder for chaining. @@ -1375,7 +1375,7 @@ public Builder addUnorderedAckIds(java.lang.String value) { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @param values The unorderedAckIds to add. * @return This builder for chaining. @@ -1393,7 +1393,7 @@ public Builder addAllUnorderedAckIds(java.lang.Iterable values * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @return This builder for chaining. */ @@ -1410,7 +1410,7 @@ public Builder clearUnorderedAckIds() { * List of acknowledgement IDs that were out of order. * * - * repeated string unordered_ack_ids = 3 [ctype = CORD]; + * repeated string unordered_ack_ids = 3; * * @param value The bytes of the unorderedAckIds to add. * @return This builder for chaining. @@ -1505,7 +1505,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return A list containing the ackIds. */ @@ -1517,7 +1517,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return The count of ackIds. */ @@ -1529,7 +1529,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the element to return. * @return The ackIds at the given index. @@ -1542,7 +1542,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the value to return. * @return The bytes of the ackIds at the given index. @@ -1557,7 +1557,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return A list containing the invalidAckIds. */ @@ -1570,7 +1570,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return The count of invalidAckIds. */ @@ -1583,7 +1583,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index of the element to return. * @return The invalidAckIds at the given index. @@ -1597,7 +1597,7 @@ public interface ModifyAckDeadlineConfirmationOrBuilder * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * 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. @@ -1667,7 +1667,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return A list containing the ackIds. */ @@ -1681,7 +1681,7 @@ public com.google.protobuf.ProtocolStringList getAckIdsList() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return The count of ackIds. */ @@ -1695,7 +1695,7 @@ public int getAckIdsCount() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the element to return. * @return The ackIds at the given index. @@ -1710,7 +1710,7 @@ public java.lang.String getAckIds(int index) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the value to return. * @return The bytes of the ackIds at the given index. @@ -1729,7 +1729,7 @@ public com.google.protobuf.ByteString getAckIdsBytes(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return A list containing the invalidAckIds. */ @@ -1744,7 +1744,7 @@ public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return The count of invalidAckIds. */ @@ -1759,7 +1759,7 @@ public int getInvalidAckIdsCount() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index of the element to return. * @return The invalidAckIds at the given index. @@ -1775,7 +1775,7 @@ public java.lang.String getInvalidAckIds(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * 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. @@ -2214,7 +2214,7 @@ private void ensureAckIdsIsMutable() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return A list containing the ackIds. */ @@ -2228,7 +2228,7 @@ public com.google.protobuf.ProtocolStringList getAckIdsList() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return The count of ackIds. */ @@ -2242,7 +2242,7 @@ public int getAckIdsCount() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the element to return. * @return The ackIds at the given index. @@ -2257,7 +2257,7 @@ public java.lang.String getAckIds(int index) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index of the value to return. * @return The bytes of the ackIds at the given index. @@ -2272,7 +2272,7 @@ public com.google.protobuf.ByteString getAckIdsBytes(int index) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param index The index to set the value at. * @param value The ackIds to set. @@ -2294,7 +2294,7 @@ public Builder setAckIds(int index, java.lang.String value) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param value The ackIds to add. * @return This builder for chaining. @@ -2315,7 +2315,7 @@ public Builder addAckIds(java.lang.String value) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param values The ackIds to add. * @return This builder for chaining. @@ -2333,7 +2333,7 @@ public Builder addAllAckIds(java.lang.Iterable values) { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @return This builder for chaining. */ @@ -2350,7 +2350,7 @@ public Builder clearAckIds() { * Successfully processed acknowledgement IDs. * * - * repeated string ack_ids = 1 [ctype = CORD]; + * repeated string ack_ids = 1; * * @param value The bytes of the ackIds to add. * @return This builder for chaining. @@ -2383,7 +2383,7 @@ private void ensureInvalidAckIdsIsMutable() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return A list containing the invalidAckIds. */ @@ -2398,7 +2398,7 @@ public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return The count of invalidAckIds. */ @@ -2413,7 +2413,7 @@ public int getInvalidAckIdsCount() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index of the element to return. * @return The invalidAckIds at the given index. @@ -2429,7 +2429,7 @@ public java.lang.String getInvalidAckIds(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * 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. @@ -2445,7 +2445,7 @@ public com.google.protobuf.ByteString getInvalidAckIdsBytes(int index) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param index The index to set the value at. * @param value The invalidAckIds to set. @@ -2468,7 +2468,7 @@ public Builder setInvalidAckIds(int index, java.lang.String value) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param value The invalidAckIds to add. * @return This builder for chaining. @@ -2490,7 +2490,7 @@ public Builder addInvalidAckIds(java.lang.String value) { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param values The invalidAckIds to add. * @return This builder for chaining. @@ -2509,7 +2509,7 @@ public Builder addAllInvalidAckIds(java.lang.Iterable values) * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @return This builder for chaining. */ @@ -2527,7 +2527,7 @@ public Builder clearInvalidAckIds() { * deadline has expired. * * - * repeated string invalid_ack_ids = 2 [ctype = CORD]; + * repeated string invalid_ack_ids = 2; * * @param value The bytes of the invalidAckIds to add. * @return This builder for chaining. 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 index d7958822e..99327262a 100644 --- 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 @@ -1085,8 +1085,8 @@ public com.google.protobuf.DurationOrBuilder getTopicMessageRetentionDurationOrB * * *
-   * Output only. An output-only field indicating whether or not the subscription can receive
-   * messages.
+   * Output only. An output-only field indicating whether or not the
+   * subscription can receive messages.
    * 
* * @@ -1103,8 +1103,8 @@ public int getStateValue() { * * *
-   * Output only. An output-only field indicating whether or not the subscription can receive
-   * messages.
+   * Output only. An output-only field indicating whether or not the
+   * subscription can receive messages.
    * 
* * @@ -4447,8 +4447,8 @@ public com.google.protobuf.DurationOrBuilder getTopicMessageRetentionDurationOrB * * *
-     * Output only. An output-only field indicating whether or not the subscription can receive
-     * messages.
+     * Output only. An output-only field indicating whether or not the
+     * subscription can receive messages.
      * 
* * @@ -4465,8 +4465,8 @@ public int getStateValue() { * * *
-     * Output only. An output-only field indicating whether or not the subscription can receive
-     * messages.
+     * Output only. An output-only field indicating whether or not the
+     * subscription can receive messages.
      * 
* * @@ -4486,8 +4486,8 @@ public Builder setStateValue(int value) { * * *
-     * Output only. An output-only field indicating whether or not the subscription can receive
-     * messages.
+     * Output only. An output-only field indicating whether or not the
+     * subscription can receive messages.
      * 
* * @@ -4507,8 +4507,8 @@ public com.google.pubsub.v1.Subscription.State getState() { * * *
-     * Output only. An output-only field indicating whether or not the subscription can receive
-     * messages.
+     * Output only. An output-only field indicating whether or not the
+     * subscription can receive messages.
      * 
* * @@ -4531,8 +4531,8 @@ public Builder setState(com.google.pubsub.v1.Subscription.State value) { * * *
-     * Output only. An output-only field indicating whether or not the subscription can receive
-     * messages.
+     * Output only. An output-only field indicating whether or not the
+     * subscription can receive messages.
      * 
* * 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 index cd5819192..63e20a119 100644 --- 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 @@ -640,8 +640,8 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. An output-only field indicating whether or not the subscription can receive
-   * messages.
+   * Output only. An output-only field indicating whether or not the
+   * subscription can receive messages.
    * 
* * @@ -655,8 +655,8 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. An output-only field indicating whether or not the subscription can receive
-   * messages.
+   * Output only. An output-only field indicating whether or not the
+   * subscription can receive messages.
    * 
* * diff --git a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto index 5ab209bbd..661633b61 100644 --- a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto +++ b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto @@ -157,6 +157,16 @@ message SchemaSettings { // 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. @@ -795,8 +805,8 @@ message Subscription { 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. + // Output only. An output-only field indicating whether or not the + // subscription can receive messages. State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -969,8 +979,8 @@ message BigQueryConfig { // subscription's backlog. bool drop_unknown_fields = 4; - // Output only. An output-only field that indicates whether or not the subscription can - // receive messages. + // 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]; } @@ -1252,25 +1262,25 @@ message StreamingPullResponse { // previously received message. message AcknowledgeConfirmation { // Successfully processed acknowledgement IDs. - repeated string ack_ids = 1 [ctype = CORD]; + repeated string ack_ids = 1; // List of acknowledgement IDs that were malformed or whose acknowledgement // deadline has expired. - repeated string invalid_ack_ids = 2 [ctype = CORD]; + repeated string invalid_ack_ids = 2; // List of acknowledgement IDs that were out of order. - repeated string unordered_ack_ids = 3 [ctype = CORD]; + repeated string unordered_ack_ids = 3; } // 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 [ctype = CORD]; + repeated string ack_ids = 1; // List of acknowledgement IDs that were malformed or whose acknowledgement // deadline has expired. - repeated string invalid_ack_ids = 2 [ctype = CORD]; + repeated string invalid_ack_ids = 2; } // Subscription properties sent as part of the response. 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 index 3cdf10d93..1b1483b87 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ 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"; @@ -63,6 +64,41 @@ service SchemaService { 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) = { @@ -120,6 +156,29 @@ message Schema { // 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. @@ -148,19 +207,6 @@ message CreateSchemaRequest { string schema_id = 3; } -// View of Schema object fields to be returned by GetSchema and ListSchemas. -enum SchemaView { - // The default / unset value. - // The API will default to the BASIC view. - SCHEMA_VIEW_UNSPECIFIED = 0; - - // Include the name and type of the schema, but not the definition. - BASIC = 1; - - // Include all Schema object fields. - FULL = 2; -} - // Request for the GetSchema method. message GetSchemaRequest { // Required. The name of the schema to get. @@ -171,8 +217,7 @@ message GetSchemaRequest { ]; // The set of fields to return in the response. If not set, returns a Schema - // with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all - // fields. + // with all fields filled out. Set to `BASIC` to omit the `definition`. SchemaView view = 2; } @@ -211,6 +256,83 @@ message ListSchemasResponse { 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" } + ]; + + // 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 `DeleteSchema` method. message DeleteSchemaRequest { // Required. Name of the schema to delete. diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index edb7988cf..5823094a4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-pubsub - 1.122.1 + 1.122.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f66d336fd..1aacf5a9d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -43,7 +43,7 @@ com.google.cloud google-cloud-pubsub - 1.122.2 + 1.123.0 diff --git a/versions.txt b/versions.txt index e8284f061..c83fc37b6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-cloud-pubsub:1.122.2:1.122.2 -grpc-google-cloud-pubsub-v1:1.104.2:1.104.2 -proto-google-cloud-pubsub-v1:1.104.2:1.104.2 +google-cloud-pubsub:1.123.0:1.123.0 +grpc-google-cloud-pubsub-v1:1.105.0:1.105.0 +proto-google-cloud-pubsub-v1:1.105.0:1.105.0