diff --git a/java-eventarc/README.md b/java-eventarc/README.md index bfe56ddbabd7..661921062a56 100644 --- a/java-eventarc/README.md +++ b/java-eventarc/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-eventarc - 1.5.0 + 1.6.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-eventarc:1.5.0' +implementation 'com.google.cloud:google-cloud-eventarc:1.6.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-eventarc" % "1.5.0" +libraryDependencies += "com.google.cloud" % "google-cloud-eventarc" % "1.6.0" ``` ## Authentication @@ -159,16 +159,16 @@ Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/eventarc/docs [javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-eventarc/latest/overview -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-eventarc/java11.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-eventarc.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-eventarc&core=gav @@ -180,9 +180,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-eventarc/blob/main/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-eventarc/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-eventarc/blob/main/LICENSE +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=eventarc.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM diff --git a/java-eventarc/google-cloud-eventarc/pom.xml b/java-eventarc/google-cloud-eventarc/pom.xml index 69c577e3c776..c1d765b6a80c 100644 --- a/java-eventarc/google-cloud-eventarc/pom.xml +++ b/java-eventarc/google-cloud-eventarc/pom.xml @@ -40,6 +40,10 @@ com.google.api.grpc proto-google-common-protos + + com.google.api.grpc + proto-google-iam-v1 + com.google.api.grpc @@ -72,6 +76,17 @@ junit test + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + com.google.api.grpc diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java index 6ad8d1a2335e..befd0432cfb5 100644 --- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java +++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java @@ -30,7 +30,16 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.eventarc.v1.stub.EventarcStub; import com.google.cloud.eventarc.v1.stub.EventarcStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -386,6 +395,7 @@ public final ListTriggersPagedResponse listTriggers(String parent) { * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") + * .setFilter("filter-1274492040") * .build(); * for (Trigger element : eventarcClient.listTriggers(request).iterateAll()) { * // doThingsWith(element); @@ -419,6 +429,7 @@ public final ListTriggersPagedResponse listTriggers(ListTriggersRequest request) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") + * .setFilter("filter-1274492040") * .build(); * ApiFuture future = eventarcClient.listTriggersPagedCallable().futureCall(request); * // Do something. @@ -452,6 +463,7 @@ public final ListTriggersPagedResponse listTriggers(ListTriggersRequest request) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") + * .setFilter("filter-1274492040") * .build(); * while (true) { * ListTriggersResponse response = eventarcClient.listTriggersCallable().call(request); @@ -2521,6 +2533,560 @@ public final OperationFuture deleteChannel return stub.deleteChannelConnectionCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a GoogleChannelConfig + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]");
+   *   GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name);
+   * }
+   * }
+ * + * @param name Required. The name of the config to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GoogleChannelConfig getGoogleChannelConfig(GoogleChannelConfigName name) { + GetGoogleChannelConfigRequest request = + GetGoogleChannelConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getGoogleChannelConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a GoogleChannelConfig + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   String name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString();
+   *   GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name);
+   * }
+   * }
+ * + * @param name Required. The name of the config to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GoogleChannelConfig getGoogleChannelConfig(String name) { + GetGoogleChannelConfigRequest request = + GetGoogleChannelConfigRequest.newBuilder().setName(name).build(); + return getGoogleChannelConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a GoogleChannelConfig + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GetGoogleChannelConfigRequest request =
+   *       GetGoogleChannelConfigRequest.newBuilder()
+   *           .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(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 GoogleChannelConfig getGoogleChannelConfig(GetGoogleChannelConfigRequest request) { + return getGoogleChannelConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a GoogleChannelConfig + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GetGoogleChannelConfigRequest request =
+   *       GetGoogleChannelConfigRequest.newBuilder()
+   *           .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       eventarcClient.getGoogleChannelConfigCallable().futureCall(request);
+   *   // Do something.
+   *   GoogleChannelConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getGoogleChannelConfigCallable() { + return stub.getGoogleChannelConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a single GoogleChannelConfig + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GoogleChannelConfig googleChannelConfig = GoogleChannelConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GoogleChannelConfig response =
+   *       eventarcClient.updateGoogleChannelConfig(googleChannelConfig, updateMask);
+   * }
+   * }
+ * + * @param googleChannelConfig Required. The config to be updated. + * @param updateMask The fields to be updated; only fields explicitly provided are updated. If no + * field mask is provided, all provided fields in the request are updated. To update all + * fields, provide a field mask of "*". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GoogleChannelConfig updateGoogleChannelConfig( + GoogleChannelConfig googleChannelConfig, FieldMask updateMask) { + UpdateGoogleChannelConfigRequest request = + UpdateGoogleChannelConfigRequest.newBuilder() + .setGoogleChannelConfig(googleChannelConfig) + .setUpdateMask(updateMask) + .build(); + return updateGoogleChannelConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a single GoogleChannelConfig + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   UpdateGoogleChannelConfigRequest request =
+   *       UpdateGoogleChannelConfigRequest.newBuilder()
+   *           .setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   GoogleChannelConfig response = eventarcClient.updateGoogleChannelConfig(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 GoogleChannelConfig updateGoogleChannelConfig( + UpdateGoogleChannelConfigRequest request) { + return updateGoogleChannelConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a single GoogleChannelConfig + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   UpdateGoogleChannelConfigRequest request =
+   *       UpdateGoogleChannelConfigRequest.newBuilder()
+   *           .setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       eventarcClient.updateGoogleChannelConfigCallable().futureCall(request);
+   *   // Do something.
+   *   GoogleChannelConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateGoogleChannelConfigCallable() { + return stub.updateGoogleChannelConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : eventarcClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = eventarcClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = eventarcClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = eventarcClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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 (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = eventarcClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = eventarcClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = eventarcClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = eventarcClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       eventarcClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + @Override public final void close() { stub.close(); @@ -2864,4 +3430,80 @@ protected ListChannelConnectionsFixedSizeCollection createCollection( return new ListChannelConnectionsFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java index c4047975c45f..a50feecfd4d8 100644 --- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java +++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; @@ -35,6 +36,15 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.eventarc.v1.stub.EventarcStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import java.io.IOException; import java.util.List; @@ -214,6 +224,45 @@ public UnaryCallSettings getProviderSettings() { return ((EventarcStubSettings) getStubSettings()).deleteChannelConnectionOperationSettings(); } + /** Returns the object with the settings used for calls to getGoogleChannelConfig. */ + public UnaryCallSettings + getGoogleChannelConfigSettings() { + return ((EventarcStubSettings) getStubSettings()).getGoogleChannelConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateGoogleChannelConfig. */ + public UnaryCallSettings + updateGoogleChannelConfigSettings() { + return ((EventarcStubSettings) getStubSettings()).updateGoogleChannelConfigSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((EventarcStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((EventarcStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((EventarcStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((EventarcStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((EventarcStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + public static final EventarcSettings create(EventarcStubSettings stub) throws IOException { return new EventarcSettings.Builder(stub.toBuilder()).build(); } @@ -471,6 +520,46 @@ public UnaryCallSettings.Builder getProviderSettin return getStubSettingsBuilder().deleteChannelConnectionOperationSettings(); } + /** Returns the builder for the settings used for calls to getGoogleChannelConfig. */ + public UnaryCallSettings.Builder + getGoogleChannelConfigSettings() { + return getStubSettingsBuilder().getGoogleChannelConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateGoogleChannelConfig. */ + public UnaryCallSettings.Builder + updateGoogleChannelConfigSettings() { + return getStubSettingsBuilder().updateGoogleChannelConfigSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + @Override public EventarcSettings build() throws IOException { return new EventarcSettings(this); diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json index 31806784a1b9..c39073db2898 100644 --- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json +++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json @@ -34,6 +34,15 @@ "GetChannelConnection": { "methods": ["getChannelConnection", "getChannelConnection", "getChannelConnection", "getChannelConnectionCallable"] }, + "GetGoogleChannelConfig": { + "methods": ["getGoogleChannelConfig", "getGoogleChannelConfig", "getGoogleChannelConfig", "getGoogleChannelConfigCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetProvider": { "methods": ["getProvider", "getProvider", "getProvider", "getProviderCallable"] }, @@ -46,15 +55,27 @@ "ListChannels": { "methods": ["listChannels", "listChannels", "listChannels", "listChannelsPagedCallable", "listChannelsCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListProviders": { "methods": ["listProviders", "listProviders", "listProviders", "listProvidersPagedCallable", "listProvidersCallable"] }, "ListTriggers": { "methods": ["listTriggers", "listTriggers", "listTriggers", "listTriggersPagedCallable", "listTriggersCallable"] }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, "UpdateChannel": { "methods": ["updateChannelAsync", "updateChannelAsync", "updateChannelOperationCallable", "updateChannelCallable"] }, + "UpdateGoogleChannelConfig": { + "methods": ["updateGoogleChannelConfig", "updateGoogleChannelConfig", "updateGoogleChannelConfigCallable"] + }, "UpdateTrigger": { "methods": ["updateTriggerAsync", "updateTriggerAsync", "updateTriggerOperationCallable", "updateTriggerCallable"] } diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java index cae189fa9d4e..1d5e1e334be2 100644 --- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java +++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; @@ -34,8 +35,10 @@ import com.google.cloud.eventarc.v1.DeleteTriggerRequest; import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.GetProviderRequest; import com.google.cloud.eventarc.v1.GetTriggerRequest; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; import com.google.cloud.eventarc.v1.ListChannelsRequest; @@ -48,7 +51,17 @@ import com.google.cloud.eventarc.v1.Provider; import com.google.cloud.eventarc.v1.Trigger; import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; @@ -199,6 +212,42 @@ public UnaryCallable listProvidersC throw new UnsupportedOperationException("Not implemented: deleteChannelConnectionCallable()"); } + public UnaryCallable + getGoogleChannelConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getGoogleChannelConfigCallable()"); + } + + public UnaryCallable + updateGoogleChannelConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateGoogleChannelConfigCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + @Override public abstract void close(); } diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java index 9a1f8f5bcec5..5763313de532 100644 --- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java +++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; @@ -60,8 +61,10 @@ import com.google.cloud.eventarc.v1.DeleteTriggerRequest; import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.GetProviderRequest; import com.google.cloud.eventarc.v1.GetTriggerRequest; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; import com.google.cloud.eventarc.v1.ListChannelsRequest; @@ -74,11 +77,21 @@ import com.google.cloud.eventarc.v1.Provider; import com.google.cloud.eventarc.v1.Trigger; import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import java.io.IOException; import java.util.List; @@ -171,6 +184,18 @@ public class EventarcStubSettings extends StubSettings { private final OperationCallSettings< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationSettings; + private final UnaryCallSettings + getGoogleChannelConfigSettings; + private final UnaryCallSettings + updateGoogleChannelConfigSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; private static final PagedListDescriptor LIST_TRIGGERS_PAGE_STR_DESC = @@ -323,6 +348,42 @@ public Iterable extractResources( } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListTriggersRequest, ListTriggersResponse, ListTriggersPagedResponse> LIST_TRIGGERS_PAGE_STR_FACT = @@ -401,6 +462,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to getTrigger. */ public UnaryCallSettings getTriggerSettings() { return getTriggerSettings; @@ -539,6 +617,45 @@ public UnaryCallSettings getProviderSettings() { return deleteChannelConnectionOperationSettings; } + /** Returns the object with the settings used for calls to getGoogleChannelConfig. */ + public UnaryCallSettings + getGoogleChannelConfigSettings() { + return getGoogleChannelConfigSettings; + } + + /** Returns the object with the settings used for calls to updateGoogleChannelConfig. */ + public UnaryCallSettings + updateGoogleChannelConfigSettings() { + return updateGoogleChannelConfigSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + public EventarcStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -669,6 +786,13 @@ protected EventarcStubSettings(Builder settingsBuilder) throws IOException { deleteChannelConnectionSettings = settingsBuilder.deleteChannelConnectionSettings().build(); deleteChannelConnectionOperationSettings = settingsBuilder.deleteChannelConnectionOperationSettings().build(); + getGoogleChannelConfigSettings = settingsBuilder.getGoogleChannelConfigSettings().build(); + updateGoogleChannelConfigSettings = settingsBuilder.updateGoogleChannelConfigSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for EventarcStubSettings. */ @@ -721,6 +845,18 @@ public static class Builder extends StubSettings.Builder deleteChannelConnectionOperationSettings; + private final UnaryCallSettings.Builder + getGoogleChannelConfigSettings; + private final UnaryCallSettings.Builder + updateGoogleChannelConfigSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -773,6 +909,13 @@ protected Builder(ClientContext clientContext) { createChannelConnectionOperationSettings = OperationCallSettings.newBuilder(); deleteChannelConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteChannelConnectionOperationSettings = OperationCallSettings.newBuilder(); + getGoogleChannelConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateGoogleChannelConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -791,7 +934,14 @@ protected Builder(ClientContext clientContext) { getChannelConnectionSettings, listChannelConnectionsSettings, createChannelConnectionSettings, - deleteChannelConnectionSettings); + deleteChannelConnectionSettings, + getGoogleChannelConfigSettings, + updateGoogleChannelConfigSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); initDefaults(this); } @@ -824,6 +974,13 @@ protected Builder(EventarcStubSettings settings) { deleteChannelConnectionSettings = settings.deleteChannelConnectionSettings.toBuilder(); deleteChannelConnectionOperationSettings = settings.deleteChannelConnectionOperationSettings.toBuilder(); + getGoogleChannelConfigSettings = settings.getGoogleChannelConfigSettings.toBuilder(); + updateGoogleChannelConfigSettings = settings.updateGoogleChannelConfigSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -842,7 +999,14 @@ protected Builder(EventarcStubSettings settings) { getChannelConnectionSettings, listChannelConnectionsSettings, createChannelConnectionSettings, - deleteChannelConnectionSettings); + deleteChannelConnectionSettings, + getGoogleChannelConfigSettings, + updateGoogleChannelConfigSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); } private static Builder createDefault() { @@ -952,6 +1116,41 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .getGoogleChannelConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateGoogleChannelConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .createTriggerOperationSettings() .setInitialCallSettings( @@ -1321,6 +1520,46 @@ public UnaryCallSettings.Builder getProviderSettin return deleteChannelConnectionOperationSettings; } + /** Returns the builder for the settings used for calls to getGoogleChannelConfig. */ + public UnaryCallSettings.Builder + getGoogleChannelConfigSettings() { + return getGoogleChannelConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateGoogleChannelConfig. */ + public UnaryCallSettings.Builder + updateGoogleChannelConfigSettings() { + return updateGoogleChannelConfigSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + @Override public EventarcStubSettings build() throws IOException { return new EventarcStubSettings(this); diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java index 29a898aefd5d..907248b7ea27 100644 --- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java +++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; @@ -38,8 +39,10 @@ import com.google.cloud.eventarc.v1.DeleteTriggerRequest; import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.GetProviderRequest; import com.google.cloud.eventarc.v1.GetTriggerRequest; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; import com.google.cloud.eventarc.v1.ListChannelsRequest; @@ -52,8 +55,18 @@ import com.google.cloud.eventarc.v1.Provider; import com.google.cloud.eventarc.v1.Trigger; import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; @@ -228,6 +241,74 @@ public class GrpcEventarcStub extends EventarcStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + getGoogleChannelConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetGoogleChannelConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetGoogleChannelConfigRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GoogleChannelConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateGoogleChannelConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateGoogleChannelConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateGoogleChannelConfigRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GoogleChannelConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private final UnaryCallable getTriggerCallable; private final UnaryCallable listTriggersCallable; private final UnaryCallable @@ -274,6 +355,18 @@ public class GrpcEventarcStub extends EventarcStub { private final OperationCallable< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationCallable; + private final UnaryCallable + getGoogleChannelConfigCallable; + private final UnaryCallable + updateGoogleChannelConfigCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -479,6 +572,81 @@ protected GrpcEventarcStub( return params.build(); }) .build(); + GrpcCallSettings + getGoogleChannelConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getGoogleChannelConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateGoogleChannelConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateGoogleChannelConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "google_channel_config.name", + String.valueOf(request.getGoogleChannelConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); this.getTriggerCallable = callableFactory.createUnaryCallable( @@ -598,6 +766,36 @@ protected GrpcEventarcStub( settings.deleteChannelConnectionOperationSettings(), clientContext, operationsStub); + this.getGoogleChannelConfigCallable = + callableFactory.createUnaryCallable( + getGoogleChannelConfigTransportSettings, + settings.getGoogleChannelConfigSettings(), + clientContext); + this.updateGoogleChannelConfigCallable = + callableFactory.createUnaryCallable( + updateGoogleChannelConfigTransportSettings, + settings.updateGoogleChannelConfigSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -761,6 +959,50 @@ public UnaryCallable listProvidersC return deleteChannelConnectionOperationCallable; } + @Override + public UnaryCallable + getGoogleChannelConfigCallable() { + return getGoogleChannelConfigCallable; + } + + @Override + public UnaryCallable + updateGoogleChannelConfigCallable() { + return updateGoogleChannelConfigCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public final void close() { try { diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java index d16f111d7004..c268fc5b7b07 100644 --- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java +++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; @@ -46,8 +47,10 @@ import com.google.cloud.eventarc.v1.DeleteTriggerRequest; import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.GetProviderRequest; import com.google.cloud.eventarc.v1.GetTriggerRequest; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; import com.google.cloud.eventarc.v1.ListChannelsRequest; @@ -60,7 +63,17 @@ import com.google.cloud.eventarc.v1.Provider; import com.google.cloud.eventarc.v1.Trigger; import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest; import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.TypeRegistry; import java.io.IOException; @@ -142,6 +155,7 @@ public class HttpJsonEventarcStub extends EventarcStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); @@ -693,6 +707,262 @@ public class HttpJsonEventarcStub extends EventarcStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + getGoogleChannelConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetGoogleChannelConfig") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/googleChannelConfig}", + 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(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GoogleChannelConfig.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateGoogleChannelConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateGoogleChannelConfig") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{googleChannelConfig.name=projects/*/locations/*/googleChannelConfig}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "googleChannelConfig.name", + request.getGoogleChannelConfig().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "googleChannelConfig", + request.getGoogleChannelConfig(), + false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GoogleChannelConfig.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + 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(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + 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(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/triggers/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/channels/*}:setIamPolicy", + "/v1/{resource=projects/*/locations/*/channelConnections/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/triggers/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/channels/*}:getIamPolicy", + "/v1/{resource=projects/*/locations/*/channelConnections/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/triggers/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/channels/*}:testIamPermissions", + "/v1/{resource=projects/*/locations/*/channelConnections/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable getTriggerCallable; private final UnaryCallable listTriggersCallable; private final UnaryCallable @@ -739,6 +1009,18 @@ public class HttpJsonEventarcStub extends EventarcStub { private final OperationCallable< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationCallable; + private final UnaryCallable + getGoogleChannelConfigCallable; + private final UnaryCallable + updateGoogleChannelConfigCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -870,6 +1152,45 @@ protected HttpJsonEventarcStub( .setMethodDescriptor(deleteChannelConnectionMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + getGoogleChannelConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getGoogleChannelConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateGoogleChannelConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateGoogleChannelConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); this.getTriggerCallable = callableFactory.createUnaryCallable( @@ -989,6 +1310,36 @@ protected HttpJsonEventarcStub( settings.deleteChannelConnectionOperationSettings(), clientContext, httpJsonOperationsStub); + this.getGoogleChannelConfigCallable = + callableFactory.createUnaryCallable( + getGoogleChannelConfigTransportSettings, + settings.getGoogleChannelConfigSettings(), + clientContext); + this.updateGoogleChannelConfigCallable = + callableFactory.createUnaryCallable( + updateGoogleChannelConfigTransportSettings, + settings.updateGoogleChannelConfigSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -1013,6 +1364,13 @@ public static List getMethodDescriptors() { methodDescriptors.add(listChannelConnectionsMethodDescriptor); methodDescriptors.add(createChannelConnectionMethodDescriptor); methodDescriptors.add(deleteChannelConnectionMethodDescriptor); + methodDescriptors.add(getGoogleChannelConfigMethodDescriptor); + methodDescriptors.add(updateGoogleChannelConfigMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); return methodDescriptors; } @@ -1174,6 +1532,50 @@ public UnaryCallable listProvidersC return deleteChannelConnectionOperationCallable; } + @Override + public UnaryCallable + getGoogleChannelConfigCallable() { + return getGoogleChannelConfigCallable; + } + + @Override + public UnaryCallable + updateGoogleChannelConfigCallable() { + return updateGoogleChannelConfigCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public final void close() { try { diff --git a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java index 752f2c4acb8e..af9056d0ab2e 100644 --- a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java +++ b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; @@ -31,9 +32,22 @@ import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.eventarc.v1.stub.HttpJsonEventarcStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Any; +import com.google.protobuf.ByteString; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import java.io.IOException; @@ -98,6 +112,7 @@ public void getTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); mockService.addResponse(expectedResponse); @@ -152,6 +167,7 @@ public void getTriggerTest2() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); mockService.addResponse(expectedResponse); @@ -306,6 +322,7 @@ public void createTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -369,6 +386,7 @@ public void createTriggerTest2() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -432,6 +450,7 @@ public void updateTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -454,6 +473,7 @@ public void updateTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -497,6 +517,7 @@ public void updateTriggerExceptionTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -521,6 +542,7 @@ public void deleteTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -582,6 +604,7 @@ public void deleteTriggerTest2() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -639,6 +662,7 @@ public void getChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); mockService.addResponse(expectedResponse); @@ -688,6 +712,7 @@ public void getChannelTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); mockService.addResponse(expectedResponse); @@ -837,6 +862,7 @@ public void createChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -895,6 +921,7 @@ public void createChannelTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -953,6 +980,7 @@ public void updateChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -970,6 +998,7 @@ public void updateChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -1007,6 +1036,7 @@ public void updateChannelExceptionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateChannelAsync(channel, updateMask).get(); @@ -1025,6 +1055,7 @@ public void deleteChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -1079,6 +1110,7 @@ public void deleteChannelTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -1758,4 +1790,433 @@ public void deleteChannelConnectionExceptionTest2() throws Exception { } catch (ExecutionException e) { } } + + @Test + public void getGoogleChannelConfigTest() throws Exception { + GoogleChannelConfig expectedResponse = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + mockService.addResponse(expectedResponse); + + GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]"); + + GoogleChannelConfig actualResponse = client.getGoogleChannelConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getGoogleChannelConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]"); + client.getGoogleChannelConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getGoogleChannelConfigTest2() throws Exception { + GoogleChannelConfig expectedResponse = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4921/locations/location-4921/googleChannelConfig"; + + GoogleChannelConfig actualResponse = client.getGoogleChannelConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getGoogleChannelConfigExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4921/locations/location-4921/googleChannelConfig"; + client.getGoogleChannelConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateGoogleChannelConfigTest() throws Exception { + GoogleChannelConfig expectedResponse = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + mockService.addResponse(expectedResponse); + + GoogleChannelConfig googleChannelConfig = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + GoogleChannelConfig actualResponse = + client.updateGoogleChannelConfig(googleChannelConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateGoogleChannelConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GoogleChannelConfig googleChannelConfig = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateGoogleChannelConfig(googleChannelConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().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 listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java index 48fd8e615de5..4f5f31a4a178 100644 --- a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java +++ b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; @@ -29,10 +30,23 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.ByteString; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; @@ -54,6 +68,8 @@ @Generated("by gapic-generator-java") public class EventarcClientTest { private static MockEventarc mockEventarc; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; private EventarcClient client; @@ -61,9 +77,12 @@ public class EventarcClientTest { @BeforeClass public static void startStaticServer() { mockEventarc = new MockEventarc(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockEventarc)); + UUID.randomUUID().toString(), + Arrays.asList(mockEventarc, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -103,6 +122,7 @@ public void getTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); mockEventarc.addResponse(expectedResponse); @@ -151,6 +171,7 @@ public void getTriggerTest2() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); mockEventarc.addResponse(expectedResponse); @@ -287,6 +308,7 @@ public void createTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -349,6 +371,7 @@ public void createTriggerTest2() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -411,6 +434,7 @@ public void updateTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -473,6 +497,7 @@ public void deleteTriggerTest() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -532,6 +557,7 @@ public void deleteTriggerTest2() throws Exception { .setTransport(Transport.newBuilder().build()) .putAllLabels(new HashMap()) .setChannel("channel738950403") + .putAllConditions(new HashMap()) .setEtag("etag3123477") .build(); Operation resultOperation = @@ -587,6 +613,7 @@ public void getChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); mockEventarc.addResponse(expectedResponse); @@ -630,6 +657,7 @@ public void getChannelTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); mockEventarc.addResponse(expectedResponse); @@ -761,6 +789,7 @@ public void createChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -818,6 +847,7 @@ public void createChannelTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -875,6 +905,7 @@ public void updateChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -929,6 +960,7 @@ public void deleteChannelTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -980,6 +1012,7 @@ public void deleteChannelTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .setProvider("provider-987494927") .setActivationToken("activationToken1276937859") + .setCryptoKeyName("cryptoKeyName1447084425") .build(); Operation resultOperation = Operation.newBuilder() @@ -1604,4 +1637,380 @@ public void deleteChannelConnectionExceptionTest2() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void getGoogleChannelConfigTest() throws Exception { + GoogleChannelConfig expectedResponse = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + mockEventarc.addResponse(expectedResponse); + + GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]"); + + GoogleChannelConfig actualResponse = client.getGoogleChannelConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEventarc.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetGoogleChannelConfigRequest actualRequest = + ((GetGoogleChannelConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getGoogleChannelConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEventarc.addException(exception); + + try { + GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]"); + client.getGoogleChannelConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getGoogleChannelConfigTest2() throws Exception { + GoogleChannelConfig expectedResponse = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + mockEventarc.addResponse(expectedResponse); + + String name = "name3373707"; + + GoogleChannelConfig actualResponse = client.getGoogleChannelConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEventarc.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetGoogleChannelConfigRequest actualRequest = + ((GetGoogleChannelConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getGoogleChannelConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEventarc.addException(exception); + + try { + String name = "name3373707"; + client.getGoogleChannelConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateGoogleChannelConfigTest() throws Exception { + GoogleChannelConfig expectedResponse = + GoogleChannelConfig.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setCryptoKeyName("cryptoKeyName1447084425") + .build(); + mockEventarc.addResponse(expectedResponse); + + GoogleChannelConfig googleChannelConfig = GoogleChannelConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + GoogleChannelConfig actualResponse = + client.updateGoogleChannelConfig(googleChannelConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEventarc.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateGoogleChannelConfigRequest actualRequest = + ((UpdateGoogleChannelConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(googleChannelConfig, actualRequest.getGoogleChannelConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateGoogleChannelConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEventarc.addException(exception); + + try { + GoogleChannelConfig googleChannelConfig = GoogleChannelConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateGoogleChannelConfig(googleChannelConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java index 88ebcf706c6d..27cb6c689ab3 100644 --- a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java +++ b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java @@ -392,4 +392,47 @@ public void deleteChannelConnection( Exception.class.getName()))); } } + + @Override + public void getGoogleChannelConfig( + GetGoogleChannelConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GoogleChannelConfig) { + requests.add(request); + responseObserver.onNext(((GoogleChannelConfig) 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 GetGoogleChannelConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GoogleChannelConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateGoogleChannelConfig( + UpdateGoogleChannelConfigRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GoogleChannelConfig) { + requests.add(request); + responseObserver.onNext(((GoogleChannelConfig) 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 UpdateGoogleChannelConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GoogleChannelConfig.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockIAMPolicy.java b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockIAMPolicy.java new file mode 100644 index 000000000000..6cf2e63c55f8 --- /dev/null +++ b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockIAMPolicyImpl.java b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..86b589fc912c --- /dev/null +++ b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockLocations.java b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockLocations.java new file mode 100644 index 000000000000..86c6a24785d1 --- /dev/null +++ b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockLocationsImpl.java b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..6475bd3bbb5a --- /dev/null +++ b/java-eventarc/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-eventarc/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java b/java-eventarc/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java index 64047eb473ea..664adcf0d5ec 100644 --- a/java-eventarc/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java +++ b/java-eventarc/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java @@ -743,6 +743,105 @@ private EventarcGrpc() {} return getDeleteChannelConnectionMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig> + getGetGoogleChannelConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetGoogleChannelConfig", + requestType = com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.class, + responseType = com.google.cloud.eventarc.v1.GoogleChannelConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig> + getGetGoogleChannelConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig> + getGetGoogleChannelConfigMethod; + if ((getGetGoogleChannelConfigMethod = EventarcGrpc.getGetGoogleChannelConfigMethod) == null) { + synchronized (EventarcGrpc.class) { + if ((getGetGoogleChannelConfigMethod = EventarcGrpc.getGetGoogleChannelConfigMethod) + == null) { + EventarcGrpc.getGetGoogleChannelConfigMethod = + getGetGoogleChannelConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetGoogleChannelConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.GoogleChannelConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new EventarcMethodDescriptorSupplier("GetGoogleChannelConfig")) + .build(); + } + } + } + return getGetGoogleChannelConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig> + getUpdateGoogleChannelConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateGoogleChannelConfig", + requestType = com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.class, + responseType = com.google.cloud.eventarc.v1.GoogleChannelConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig> + getUpdateGoogleChannelConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig> + getUpdateGoogleChannelConfigMethod; + if ((getUpdateGoogleChannelConfigMethod = EventarcGrpc.getUpdateGoogleChannelConfigMethod) + == null) { + synchronized (EventarcGrpc.class) { + if ((getUpdateGoogleChannelConfigMethod = EventarcGrpc.getUpdateGoogleChannelConfigMethod) + == null) { + EventarcGrpc.getUpdateGoogleChannelConfigMethod = + getUpdateGoogleChannelConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateGoogleChannelConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.GoogleChannelConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new EventarcMethodDescriptorSupplier("UpdateGoogleChannelConfig")) + .build(); + } + } + } + return getUpdateGoogleChannelConfigMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static EventarcStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -1020,6 +1119,36 @@ public void deleteChannelConnection( getDeleteChannelConnectionMethod(), responseObserver); } + /** + * + * + *
+     * Get a GoogleChannelConfig
+     * 
+ */ + public void getGoogleChannelConfig( + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetGoogleChannelConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Update a single GoogleChannelConfig
+     * 
+ */ + public void updateGoogleChannelConfig( + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateGoogleChannelConfigMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -1124,6 +1253,20 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest, com.google.longrunning.Operation>(this, METHODID_DELETE_CHANNEL_CONNECTION))) + .addMethod( + getGetGoogleChannelConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig>( + this, METHODID_GET_GOOGLE_CHANNEL_CONFIG))) + .addMethod( + getUpdateGoogleChannelConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest, + com.google.cloud.eventarc.v1.GoogleChannelConfig>( + this, METHODID_UPDATE_GOOGLE_CHANNEL_CONFIG))) .build(); } } @@ -1402,6 +1545,40 @@ public void deleteChannelConnection( request, responseObserver); } + + /** + * + * + *
+     * Get a GoogleChannelConfig
+     * 
+ */ + public void getGoogleChannelConfig( + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetGoogleChannelConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update a single GoogleChannelConfig
+     * 
+ */ + public void updateGoogleChannelConfig( + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateGoogleChannelConfigMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -1630,6 +1807,32 @@ public com.google.longrunning.Operation deleteChannelConnection( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteChannelConnectionMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Get a GoogleChannelConfig
+     * 
+ */ + public com.google.cloud.eventarc.v1.GoogleChannelConfig getGoogleChannelConfig( + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetGoogleChannelConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update a single GoogleChannelConfig
+     * 
+ */ + public com.google.cloud.eventarc.v1.GoogleChannelConfig updateGoogleChannelConfig( + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateGoogleChannelConfigMethod(), getCallOptions(), request); + } } /** @@ -1865,6 +2068,35 @@ protected EventarcFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteChannelConnectionMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Get a GoogleChannelConfig
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.eventarc.v1.GoogleChannelConfig> + getGoogleChannelConfig(com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetGoogleChannelConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update a single GoogleChannelConfig
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.eventarc.v1.GoogleChannelConfig> + updateGoogleChannelConfig( + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateGoogleChannelConfigMethod(), getCallOptions()), request); + } } private static final int METHODID_GET_TRIGGER = 0; @@ -1883,6 +2115,8 @@ protected EventarcFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions private static final int METHODID_LIST_CHANNEL_CONNECTIONS = 13; private static final int METHODID_CREATE_CHANNEL_CONNECTION = 14; private static final int METHODID_DELETE_CHANNEL_CONNECTION = 15; + private static final int METHODID_GET_GOOGLE_CHANNEL_CONFIG = 16; + private static final int METHODID_UPDATE_GOOGLE_CHANNEL_CONFIG = 17; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1988,6 +2222,18 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_GOOGLE_CHANNEL_CONFIG: + serviceImpl.getGoogleChannelConfig( + (com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_GOOGLE_CHANNEL_CONFIG: + serviceImpl.updateGoogleChannelConfig( + (com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; default: throw new AssertionError(); } @@ -2066,6 +2312,8 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListChannelConnectionsMethod()) .addMethod(getCreateChannelConnectionMethod()) .addMethod(getDeleteChannelConnectionMethod()) + .addMethod(getGetGoogleChannelConfigMethod()) + .addMethod(getUpdateGoogleChannelConfigMethod()) .build(); } } diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Channel.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Channel.java index 1b79f9c4ae43..db7c96a8d331 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Channel.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Channel.java @@ -46,6 +46,7 @@ private Channel() { provider_ = ""; state_ = 0; activationToken_ = ""; + cryptoKeyName_ = ""; } @java.lang.Override @@ -123,7 +124,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The INACTIVE state means that the Channel cannot receive events
+     * The INACTIVE state indicates that the Channel cannot receive events
      * permanently. There are two possible cases this state can happen:
      * 1. The SaaS provider disconnected from this Channel.
      * 2. The Channel activation token has expired but the SaaS provider
@@ -177,7 +178,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum {
      *
      *
      * 
-     * The INACTIVE state means that the Channel cannot receive events
+     * The INACTIVE state indicates that the Channel cannot receive events
      * permanently. There are two possible cases this state can happen:
      * 1. The SaaS provider disconnected from this Channel.
      * 2. The Channel activation token has expired but the SaaS provider
@@ -325,8 +326,8 @@ public TransportCase getTransportCase() {
    *
    *
    * 
-   * Required. The resource name of the channel. Must be unique within the location
-   * on the project and must be in
+   * Required. The resource name of the channel. Must be unique within the
+   * location on the project and must be in
    * `projects/{project}/locations/{location}/channels/{channel_id}` format.
    * 
* @@ -350,8 +351,8 @@ public java.lang.String getName() { * * *
-   * Required. The resource name of the channel. Must be unique within the location
-   * on the project and must be in
+   * Required. The resource name of the channel. Must be unique within the
+   * location on the project and must be in
    * `projects/{project}/locations/{location}/channels/{channel_id}` format.
    * 
* @@ -378,8 +379,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-   * string and guaranteed to remain unchanged until the resource is deleted.
+   * Output only. Server assigned unique identifier for the channel. The value
+   * is a UUID4 string and guaranteed to remain unchanged until the resource is
+   * deleted.
    * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -402,8 +404,9 @@ public java.lang.String getUid() { * * *
-   * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-   * string and guaranteed to remain unchanged until the resource is deleted.
+   * Output only. Server assigned unique identifier for the channel. The value
+   * is a UUID4 string and guaranteed to remain unchanged until the resource is
+   * deleted.
    * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -527,13 +530,13 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-   * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+   * The name of the event provider (e.g. Eventarc SaaS partner) associated
    * with the channel. This provider will be granted permissions to publish
    * events to the channel. Format:
    * `projects/{project}/locations/{location}/providers/{provider_id}`.
    * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @return The provider. */ @@ -553,13 +556,13 @@ public java.lang.String getProvider() { * * *
-   * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+   * The name of the event provider (e.g. Eventarc SaaS partner) associated
    * with the channel. This provider will be granted permissions to publish
    * events to the channel. Format:
    * `projects/{project}/locations/{location}/providers/{provider_id}`.
    * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @return The bytes for provider. */ @@ -581,8 +584,8 @@ public com.google.protobuf.ByteString getProviderBytes() { * * *
-   * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-   * a transport for the event delivery. Format:
+   * Output only. The name of the Pub/Sub topic created and managed by
+   * Eventarc system as a transport for the event delivery. Format:
    * `projects/{project}/topics/{topic_id}`.
    * 
* @@ -597,8 +600,8 @@ public boolean hasPubsubTopic() { * * *
-   * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-   * a transport for the event delivery. Format:
+   * Output only. The name of the Pub/Sub topic created and managed by
+   * Eventarc system as a transport for the event delivery. Format:
    * `projects/{project}/topics/{topic_id}`.
    * 
* @@ -626,8 +629,8 @@ public java.lang.String getPubsubTopic() { * * *
-   * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-   * a transport for the event delivery. Format:
+   * Output only. The name of the Pub/Sub topic created and managed by
+   * Eventarc system as a transport for the event delivery. Format:
    * `projects/{project}/topics/{topic_id}`.
    * 
* @@ -698,8 +701,8 @@ public com.google.cloud.eventarc.v1.Channel.State getState() { * * *
-   * Output only. The activation token for the channel. The token must be used by the
-   * provider to register the channel for publishing.
+   * Output only. The activation token for the channel. The token must be used
+   * by the provider to register the channel for publishing.
    * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -722,8 +725,8 @@ public java.lang.String getActivationToken() { * * *
-   * Output only. The activation token for the channel. The token must be used by the
-   * provider to register the channel for publishing.
+   * Output only. The activation token for the channel. The token must be used
+   * by the provider to register the channel for publishing.
    * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -743,6 +746,65 @@ public com.google.protobuf.ByteString getActivationTokenBytes() { } } + public static final int CRYPTO_KEY_NAME_FIELD_NUMBER = 11; + private volatile java.lang.Object cryptoKeyName_; + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The cryptoKeyName. + */ + @java.lang.Override + public java.lang.String getCryptoKeyName() { + java.lang.Object ref = cryptoKeyName_; + 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(); + cryptoKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cryptoKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCryptoKeyNameBytes() { + java.lang.Object ref = cryptoKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cryptoKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -781,6 +843,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(activationToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, activationToken_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cryptoKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, cryptoKeyName_); + } getUnknownFields().writeTo(output); } @@ -814,6 +879,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(activationToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, activationToken_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cryptoKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, cryptoKeyName_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -842,6 +910,7 @@ public boolean equals(final java.lang.Object obj) { if (!getProvider().equals(other.getProvider())) return false; if (state_ != other.state_) return false; if (!getActivationToken().equals(other.getActivationToken())) return false; + if (!getCryptoKeyName().equals(other.getCryptoKeyName())) return false; if (!getTransportCase().equals(other.getTransportCase())) return false; switch (transportCase_) { case 8: @@ -879,6 +948,8 @@ public int hashCode() { hash = (53 * hash) + state_; hash = (37 * hash) + ACTIVATION_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getActivationToken().hashCode(); + hash = (37 * hash) + CRYPTO_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCryptoKeyName().hashCode(); switch (transportCase_) { case 8: hash = (37 * hash) + PUBSUB_TOPIC_FIELD_NUMBER; @@ -1049,6 +1120,8 @@ public Builder clear() { activationToken_ = ""; + cryptoKeyName_ = ""; + transportCase_ = 0; transport_ = null; return this; @@ -1095,6 +1168,7 @@ public com.google.cloud.eventarc.v1.Channel buildPartial() { } result.state_ = state_; result.activationToken_ = activationToken_; + result.cryptoKeyName_ = cryptoKeyName_; result.transportCase_ = transportCase_; onBuilt(); return result; @@ -1170,6 +1244,10 @@ public Builder mergeFrom(com.google.cloud.eventarc.v1.Channel other) { activationToken_ = other.activationToken_; onChanged(); } + if (!other.getCryptoKeyName().isEmpty()) { + cryptoKeyName_ = other.cryptoKeyName_; + onChanged(); + } switch (other.getTransportCase()) { case PUBSUB_TOPIC: { @@ -1258,6 +1336,12 @@ public Builder mergeFrom( break; } // case 82 + case 90: + { + cryptoKeyName_ = input.readStringRequireUtf8(); + + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1294,8 +1378,8 @@ public Builder clearTransport() { * * *
-     * Required. The resource name of the channel. Must be unique within the location
-     * on the project and must be in
+     * Required. The resource name of the channel. Must be unique within the
+     * location on the project and must be in
      * `projects/{project}/locations/{location}/channels/{channel_id}` format.
      * 
* @@ -1318,8 +1402,8 @@ public java.lang.String getName() { * * *
-     * Required. The resource name of the channel. Must be unique within the location
-     * on the project and must be in
+     * Required. The resource name of the channel. Must be unique within the
+     * location on the project and must be in
      * `projects/{project}/locations/{location}/channels/{channel_id}` format.
      * 
* @@ -1342,8 +1426,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The resource name of the channel. Must be unique within the location
-     * on the project and must be in
+     * Required. The resource name of the channel. Must be unique within the
+     * location on the project and must be in
      * `projects/{project}/locations/{location}/channels/{channel_id}` format.
      * 
* @@ -1365,8 +1449,8 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The resource name of the channel. Must be unique within the location
-     * on the project and must be in
+     * Required. The resource name of the channel. Must be unique within the
+     * location on the project and must be in
      * `projects/{project}/locations/{location}/channels/{channel_id}` format.
      * 
* @@ -1384,8 +1468,8 @@ public Builder clearName() { * * *
-     * Required. The resource name of the channel. Must be unique within the location
-     * on the project and must be in
+     * Required. The resource name of the channel. Must be unique within the
+     * location on the project and must be in
      * `projects/{project}/locations/{location}/channels/{channel_id}` format.
      * 
* @@ -1410,8 +1494,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-     * string and guaranteed to remain unchanged until the resource is deleted.
+     * Output only. Server assigned unique identifier for the channel. The value
+     * is a UUID4 string and guaranteed to remain unchanged until the resource is
+     * deleted.
      * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1433,8 +1518,9 @@ public java.lang.String getUid() { * * *
-     * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-     * string and guaranteed to remain unchanged until the resource is deleted.
+     * Output only. Server assigned unique identifier for the channel. The value
+     * is a UUID4 string and guaranteed to remain unchanged until the resource is
+     * deleted.
      * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1456,8 +1542,9 @@ public com.google.protobuf.ByteString getUidBytes() { * * *
-     * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-     * string and guaranteed to remain unchanged until the resource is deleted.
+     * Output only. Server assigned unique identifier for the channel. The value
+     * is a UUID4 string and guaranteed to remain unchanged until the resource is
+     * deleted.
      * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1478,8 +1565,9 @@ public Builder setUid(java.lang.String value) { * * *
-     * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-     * string and guaranteed to remain unchanged until the resource is deleted.
+     * Output only. Server assigned unique identifier for the channel. The value
+     * is a UUID4 string and guaranteed to remain unchanged until the resource is
+     * deleted.
      * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1496,8 +1584,9 @@ public Builder clearUid() { * * *
-     * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-     * string and guaranteed to remain unchanged until the resource is deleted.
+     * Output only. Server assigned unique identifier for the channel. The value
+     * is a UUID4 string and guaranteed to remain unchanged until the resource is
+     * deleted.
      * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1923,13 +2012,13 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-     * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+     * The name of the event provider (e.g. Eventarc SaaS partner) associated
      * with the channel. This provider will be granted permissions to publish
      * events to the channel. Format:
      * `projects/{project}/locations/{location}/providers/{provider_id}`.
      * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @return The provider. */ @@ -1948,13 +2037,13 @@ public java.lang.String getProvider() { * * *
-     * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+     * The name of the event provider (e.g. Eventarc SaaS partner) associated
      * with the channel. This provider will be granted permissions to publish
      * events to the channel. Format:
      * `projects/{project}/locations/{location}/providers/{provider_id}`.
      * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @return The bytes for provider. */ @@ -1973,13 +2062,13 @@ public com.google.protobuf.ByteString getProviderBytes() { * * *
-     * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+     * The name of the event provider (e.g. Eventarc SaaS partner) associated
      * with the channel. This provider will be granted permissions to publish
      * events to the channel. Format:
      * `projects/{project}/locations/{location}/providers/{provider_id}`.
      * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @param value The provider to set. * @return This builder for chaining. @@ -1997,13 +2086,13 @@ public Builder setProvider(java.lang.String value) { * * *
-     * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+     * The name of the event provider (e.g. Eventarc SaaS partner) associated
      * with the channel. This provider will be granted permissions to publish
      * events to the channel. Format:
      * `projects/{project}/locations/{location}/providers/{provider_id}`.
      * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @return This builder for chaining. */ @@ -2017,13 +2106,13 @@ public Builder clearProvider() { * * *
-     * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+     * The name of the event provider (e.g. Eventarc SaaS partner) associated
      * with the channel. This provider will be granted permissions to publish
      * events to the channel. Format:
      * `projects/{project}/locations/{location}/providers/{provider_id}`.
      * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @param value The bytes for provider to set. * @return This builder for chaining. @@ -2043,8 +2132,8 @@ public Builder setProviderBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-     * a transport for the event delivery. Format:
+     * Output only. The name of the Pub/Sub topic created and managed by
+     * Eventarc system as a transport for the event delivery. Format:
      * `projects/{project}/topics/{topic_id}`.
      * 
* @@ -2060,8 +2149,8 @@ public boolean hasPubsubTopic() { * * *
-     * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-     * a transport for the event delivery. Format:
+     * Output only. The name of the Pub/Sub topic created and managed by
+     * Eventarc system as a transport for the event delivery. Format:
      * `projects/{project}/topics/{topic_id}`.
      * 
* @@ -2090,8 +2179,8 @@ public java.lang.String getPubsubTopic() { * * *
-     * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-     * a transport for the event delivery. Format:
+     * Output only. The name of the Pub/Sub topic created and managed by
+     * Eventarc system as a transport for the event delivery. Format:
      * `projects/{project}/topics/{topic_id}`.
      * 
* @@ -2120,8 +2209,8 @@ public com.google.protobuf.ByteString getPubsubTopicBytes() { * * *
-     * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-     * a transport for the event delivery. Format:
+     * Output only. The name of the Pub/Sub topic created and managed by
+     * Eventarc system as a transport for the event delivery. Format:
      * `projects/{project}/topics/{topic_id}`.
      * 
* @@ -2143,8 +2232,8 @@ public Builder setPubsubTopic(java.lang.String value) { * * *
-     * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-     * a transport for the event delivery. Format:
+     * Output only. The name of the Pub/Sub topic created and managed by
+     * Eventarc system as a transport for the event delivery. Format:
      * `projects/{project}/topics/{topic_id}`.
      * 
* @@ -2164,8 +2253,8 @@ public Builder clearPubsubTopic() { * * *
-     * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-     * a transport for the event delivery. Format:
+     * Output only. The name of the Pub/Sub topic created and managed by
+     * Eventarc system as a transport for the event delivery. Format:
      * `projects/{project}/topics/{topic_id}`.
      * 
* @@ -2291,8 +2380,8 @@ public Builder clearState() { * * *
-     * Output only. The activation token for the channel. The token must be used by the
-     * provider to register the channel for publishing.
+     * Output only. The activation token for the channel. The token must be used
+     * by the provider to register the channel for publishing.
      * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2314,8 +2403,8 @@ public java.lang.String getActivationToken() { * * *
-     * Output only. The activation token for the channel. The token must be used by the
-     * provider to register the channel for publishing.
+     * Output only. The activation token for the channel. The token must be used
+     * by the provider to register the channel for publishing.
      * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2337,8 +2426,8 @@ public com.google.protobuf.ByteString getActivationTokenBytes() { * * *
-     * Output only. The activation token for the channel. The token must be used by the
-     * provider to register the channel for publishing.
+     * Output only. The activation token for the channel. The token must be used
+     * by the provider to register the channel for publishing.
      * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2359,8 +2448,8 @@ public Builder setActivationToken(java.lang.String value) { * * *
-     * Output only. The activation token for the channel. The token must be used by the
-     * provider to register the channel for publishing.
+     * Output only. The activation token for the channel. The token must be used
+     * by the provider to register the channel for publishing.
      * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2377,8 +2466,8 @@ public Builder clearActivationToken() { * * *
-     * Output only. The activation token for the channel. The token must be used by the
-     * provider to register the channel for publishing.
+     * Output only. The activation token for the channel. The token must be used
+     * by the provider to register the channel for publishing.
      * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2397,6 +2486,137 @@ public Builder setActivationTokenBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object cryptoKeyName_ = ""; + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The cryptoKeyName. + */ + public java.lang.String getCryptoKeyName() { + java.lang.Object ref = cryptoKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cryptoKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cryptoKeyName. + */ + public com.google.protobuf.ByteString getCryptoKeyNameBytes() { + java.lang.Object ref = cryptoKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cryptoKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The cryptoKeyName to set. + * @return This builder for chaining. + */ + public Builder setCryptoKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cryptoKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearCryptoKeyName() { + + cryptoKeyName_ = getDefaultInstance().getCryptoKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for cryptoKeyName to set. + * @return This builder for chaining. + */ + public Builder setCryptoKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cryptoKeyName_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelOrBuilder.java index 3ebf9307b7c8..615711d54aca 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelOrBuilder.java @@ -27,8 +27,8 @@ public interface ChannelOrBuilder * * *
-   * Required. The resource name of the channel. Must be unique within the location
-   * on the project and must be in
+   * Required. The resource name of the channel. Must be unique within the
+   * location on the project and must be in
    * `projects/{project}/locations/{location}/channels/{channel_id}` format.
    * 
* @@ -41,8 +41,8 @@ public interface ChannelOrBuilder * * *
-   * Required. The resource name of the channel. Must be unique within the location
-   * on the project and must be in
+   * Required. The resource name of the channel. Must be unique within the
+   * location on the project and must be in
    * `projects/{project}/locations/{location}/channels/{channel_id}` format.
    * 
* @@ -56,8 +56,9 @@ public interface ChannelOrBuilder * * *
-   * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-   * string and guaranteed to remain unchanged until the resource is deleted.
+   * Output only. Server assigned unique identifier for the channel. The value
+   * is a UUID4 string and guaranteed to remain unchanged until the resource is
+   * deleted.
    * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -69,8 +70,9 @@ public interface ChannelOrBuilder * * *
-   * Output only. Server assigned unique identifier for the channel. The value is a UUID4
-   * string and guaranteed to remain unchanged until the resource is deleted.
+   * Output only. Server assigned unique identifier for the channel. The value
+   * is a UUID4 string and guaranteed to remain unchanged until the resource is
+   * deleted.
    * 
* * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -159,13 +161,13 @@ public interface ChannelOrBuilder * * *
-   * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+   * The name of the event provider (e.g. Eventarc SaaS partner) associated
    * with the channel. This provider will be granted permissions to publish
    * events to the channel. Format:
    * `projects/{project}/locations/{location}/providers/{provider_id}`.
    * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @return The provider. */ @@ -174,13 +176,13 @@ public interface ChannelOrBuilder * * *
-   * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
+   * The name of the event provider (e.g. Eventarc SaaS partner) associated
    * with the channel. This provider will be granted permissions to publish
    * events to the channel. Format:
    * `projects/{project}/locations/{location}/providers/{provider_id}`.
    * 
* - * string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * string provider = 7; * * @return The bytes for provider. */ @@ -190,8 +192,8 @@ public interface ChannelOrBuilder * * *
-   * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-   * a transport for the event delivery. Format:
+   * Output only. The name of the Pub/Sub topic created and managed by
+   * Eventarc system as a transport for the event delivery. Format:
    * `projects/{project}/topics/{topic_id}`.
    * 
* @@ -204,8 +206,8 @@ public interface ChannelOrBuilder * * *
-   * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-   * a transport for the event delivery. Format:
+   * Output only. The name of the Pub/Sub topic created and managed by
+   * Eventarc system as a transport for the event delivery. Format:
    * `projects/{project}/topics/{topic_id}`.
    * 
* @@ -218,8 +220,8 @@ public interface ChannelOrBuilder * * *
-   * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
-   * a transport for the event delivery. Format:
+   * Output only. The name of the Pub/Sub topic created and managed by
+   * Eventarc system as a transport for the event delivery. Format:
    * `projects/{project}/topics/{topic_id}`.
    * 
* @@ -262,8 +264,8 @@ public interface ChannelOrBuilder * * *
-   * Output only. The activation token for the channel. The token must be used by the
-   * provider to register the channel for publishing.
+   * Output only. The activation token for the channel. The token must be used
+   * by the provider to register the channel for publishing.
    * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -275,8 +277,8 @@ public interface ChannelOrBuilder * * *
-   * Output only. The activation token for the channel. The token must be used by the
-   * provider to register the channel for publishing.
+   * Output only. The activation token for the channel. The token must be used
+   * by the provider to register the channel for publishing.
    * 
* * string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -285,5 +287,40 @@ public interface ChannelOrBuilder */ com.google.protobuf.ByteString getActivationTokenBytes(); + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The cryptoKeyName. + */ + java.lang.String getCryptoKeyName(); + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cryptoKeyName. + */ + com.google.protobuf.ByteString getCryptoKeyNameBytes(); + public com.google.cloud.eventarc.v1.Channel.TransportCase getTransportCase(); } diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelProto.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelProto.java index 39dab337c1c3..0ef41cd84d78 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelProto.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ChannelProto.java @@ -44,24 +44,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\022\030google.cloud.eventarc.v1\032\037google/api/f" + "ield_behavior.proto\032\031google/api/resource" + ".proto\032\037google/protobuf/timestamp.proto\"" - + "\363\003\n\007Channel\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\020\n\003uid\030\002 " + + "\262\004\n\007Channel\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\020\n\003uid\030\002 " + "\001(\tB\003\340A\003\0224\n\013create_time\030\005 \001(\0132\032.google.p" + "rotobuf.TimestampB\003\340A\003\0224\n\013update_time\030\006 " - + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\025\n\010" - + "provider\030\007 \001(\tB\003\340A\002\022\033\n\014pubsub_topic\030\010 \001(" - + "\tB\003\340A\003H\000\022;\n\005state\030\t \001(\0162\'.google.cloud.e" - + "ventarc.v1.Channel.StateB\003\340A\003\022\035\n\020activat" - + "ion_token\030\n \001(\tB\003\340A\003\"E\n\005State\022\025\n\021STATE_U" - + "NSPECIFIED\020\000\022\013\n\007PENDING\020\001\022\n\n\006ACTIVE\020\002\022\014\n" - + "\010INACTIVE\020\003:s\352Ap\n\037eventarc.googleapis.co" - + "m/Channel\022:projects/{project}/locations/" - + "{location}/channels/{channel}*\010channels2" - + "\007channelB\013\n\ttransportB\304\001\n\034com.google.clo" - + "ud.eventarc.v1B\014ChannelProtoP\001Z@google.g" - + "olang.org/genproto/googleapis/cloud/even" - + "tarc/v1;eventarc\252\002\030Google.Cloud.Eventarc" - + ".V1\312\002\030Google\\Cloud\\Eventarc\\V1\352\002\033Google:" - + ":Cloud::Eventarc::V1b\006proto3" + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\020\n\010" + + "provider\030\007 \001(\t\022\033\n\014pubsub_topic\030\010 \001(\tB\003\340A" + + "\003H\000\022;\n\005state\030\t \001(\0162\'.google.cloud.eventa" + + "rc.v1.Channel.StateB\003\340A\003\022\035\n\020activation_t" + + "oken\030\n \001(\tB\003\340A\003\022B\n\017crypto_key_name\030\013 \001(\t" + + "B)\340A\001\372A#\n!cloudkms.googleapis.com/Crypto" + + "Key\"E\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007P" + + "ENDING\020\001\022\n\n\006ACTIVE\020\002\022\014\n\010INACTIVE\020\003:s\352Ap\n" + + "\037eventarc.googleapis.com/Channel\022:projec" + + "ts/{project}/locations/{location}/channe" + + "ls/{channel}*\010channels2\007channelB\013\n\ttrans" + + "portB\304\001\n\034com.google.cloud.eventarc.v1B\014C" + + "hannelProtoP\001Z@google.golang.org/genprot" + + "o/googleapis/cloud/eventarc/v1;eventarc\252" + + "\002\030Google.Cloud.Eventarc.V1\312\002\030Google\\Clou" + + "d\\Eventarc\\V1\352\002\033Google::Cloud::Eventarc:" + + ":V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -85,12 +87,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PubsubTopic", "State", "ActivationToken", + "CryptoKeyName", "Transport", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Destination.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Destination.java index 177578bebf00..bb9df3dc1e7a 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Destination.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Destination.java @@ -75,6 +75,7 @@ public enum DescriptorCase CLOUD_RUN(1), CLOUD_FUNCTION(2), GKE(3), + WORKFLOW(4), DESCRIPTOR_NOT_SET(0); private final int value; @@ -99,6 +100,8 @@ public static DescriptorCase forNumber(int value) { return CLOUD_FUNCTION; case 3: return GKE; + case 4: + return WORKFLOW; case 0: return DESCRIPTOR_NOT_SET; default: @@ -296,6 +299,85 @@ public com.google.cloud.eventarc.v1.GKEOrBuilder getGkeOrBuilder() { return com.google.cloud.eventarc.v1.GKE.getDefaultInstance(); } + public static final int WORKFLOW_FIELD_NUMBER = 4; + /** + * + * + *
+   * The resource name of the Workflow whose Executions are triggered by
+   * the events. The Workflow resource should be deployed in the same project
+   * as the trigger.
+   * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+   * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return Whether the workflow field is set. + */ + public boolean hasWorkflow() { + return descriptorCase_ == 4; + } + /** + * + * + *
+   * The resource name of the Workflow whose Executions are triggered by
+   * the events. The Workflow resource should be deployed in the same project
+   * as the trigger.
+   * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+   * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return The workflow. + */ + public java.lang.String getWorkflow() { + java.lang.Object ref = ""; + if (descriptorCase_ == 4) { + ref = descriptor_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (descriptorCase_ == 4) { + descriptor_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of the Workflow whose Executions are triggered by
+   * the events. The Workflow resource should be deployed in the same project
+   * as the trigger.
+   * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+   * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workflow. + */ + public com.google.protobuf.ByteString getWorkflowBytes() { + java.lang.Object ref = ""; + if (descriptorCase_ == 4) { + ref = descriptor_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (descriptorCase_ == 4) { + descriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -319,6 +401,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (descriptorCase_ == 3) { output.writeMessage(3, (com.google.cloud.eventarc.v1.GKE) descriptor_); } + if (descriptorCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, descriptor_); + } getUnknownFields().writeTo(output); } @@ -341,6 +426,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 3, (com.google.cloud.eventarc.v1.GKE) descriptor_); } + if (descriptorCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, descriptor_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -367,6 +455,9 @@ public boolean equals(final java.lang.Object obj) { case 3: if (!getGke().equals(other.getGke())) return false; break; + case 4: + if (!getWorkflow().equals(other.getWorkflow())) return false; + break; case 0: default: } @@ -394,6 +485,10 @@ public int hashCode() { hash = (37 * hash) + GKE_FIELD_NUMBER; hash = (53 * hash) + getGke().hashCode(); break; + case 4: + hash = (37 * hash) + WORKFLOW_FIELD_NUMBER; + hash = (53 * hash) + getWorkflow().hashCode(); + break; case 0: default: } @@ -587,6 +682,9 @@ public com.google.cloud.eventarc.v1.Destination buildPartial() { result.descriptor_ = gkeBuilder_.build(); } } + if (descriptorCase_ == 4) { + result.descriptor_ = descriptor_; + } result.descriptorCase_ = descriptorCase_; onBuilt(); return result; @@ -655,6 +753,13 @@ public Builder mergeFrom(com.google.cloud.eventarc.v1.Destination other) { mergeGke(other.getGke()); break; } + case WORKFLOW: + { + descriptorCase_ = 4; + descriptor_ = other.descriptor_; + onChanged(); + break; + } case DESCRIPTOR_NOT_SET: { break; @@ -705,6 +810,13 @@ public Builder mergeFrom( descriptorCase_ = 3; break; } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + descriptorCase_ = 4; + descriptor_ = s; + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1314,6 +1426,158 @@ public com.google.cloud.eventarc.v1.GKEOrBuilder getGkeOrBuilder() { return gkeBuilder_; } + /** + * + * + *
+     * The resource name of the Workflow whose Executions are triggered by
+     * the events. The Workflow resource should be deployed in the same project
+     * as the trigger.
+     * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+     * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return Whether the workflow field is set. + */ + @java.lang.Override + public boolean hasWorkflow() { + return descriptorCase_ == 4; + } + /** + * + * + *
+     * The resource name of the Workflow whose Executions are triggered by
+     * the events. The Workflow resource should be deployed in the same project
+     * as the trigger.
+     * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+     * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return The workflow. + */ + @java.lang.Override + public java.lang.String getWorkflow() { + java.lang.Object ref = ""; + if (descriptorCase_ == 4) { + ref = descriptor_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (descriptorCase_ == 4) { + descriptor_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the Workflow whose Executions are triggered by
+     * the events. The Workflow resource should be deployed in the same project
+     * as the trigger.
+     * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+     * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workflow. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkflowBytes() { + java.lang.Object ref = ""; + if (descriptorCase_ == 4) { + ref = descriptor_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (descriptorCase_ == 4) { + descriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the Workflow whose Executions are triggered by
+     * the events. The Workflow resource should be deployed in the same project
+     * as the trigger.
+     * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+     * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The workflow to set. + * @return This builder for chaining. + */ + public Builder setWorkflow(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + descriptorCase_ = 4; + descriptor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Workflow whose Executions are triggered by
+     * the events. The Workflow resource should be deployed in the same project
+     * as the trigger.
+     * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+     * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearWorkflow() { + if (descriptorCase_ == 4) { + descriptorCase_ = 0; + descriptor_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of the Workflow whose Executions are triggered by
+     * the events. The Workflow resource should be deployed in the same project
+     * as the trigger.
+     * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+     * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for workflow to set. + * @return This builder for chaining. + */ + public Builder setWorkflowBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + descriptorCase_ = 4; + descriptor_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DestinationOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DestinationOrBuilder.java index 3f0b9cd21876..11f694fbc1bc 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DestinationOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DestinationOrBuilder.java @@ -139,5 +139,51 @@ public interface DestinationOrBuilder */ com.google.cloud.eventarc.v1.GKEOrBuilder getGkeOrBuilder(); + /** + * + * + *
+   * The resource name of the Workflow whose Executions are triggered by
+   * the events. The Workflow resource should be deployed in the same project
+   * as the trigger.
+   * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+   * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return Whether the workflow field is set. + */ + boolean hasWorkflow(); + /** + * + * + *
+   * The resource name of the Workflow whose Executions are triggered by
+   * the events. The Workflow resource should be deployed in the same project
+   * as the trigger.
+   * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+   * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return The workflow. + */ + java.lang.String getWorkflow(); + /** + * + * + *
+   * The resource name of the Workflow whose Executions are triggered by
+   * the events. The Workflow resource should be deployed in the same project
+   * as the trigger.
+   * Format: `projects/{project}/locations/{location}/workflows/{workflow}`
+   * 
+ * + * string workflow = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workflow. + */ + com.google.protobuf.ByteString getWorkflowBytes(); + public com.google.cloud.eventarc.v1.Destination.DescriptorCase getDescriptorCase(); } diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java index cbb0319eb012..bdd9b88dd361 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java @@ -107,6 +107,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_eventarc_v1_DeleteChannelConnectionRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_eventarc_v1_DeleteChannelConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_eventarc_v1_OperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -127,173 +135,194 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "gle/api/resource.proto\032&google/cloud/eve" + "ntarc/v1/channel.proto\0321google/cloud/eve" + "ntarc/v1/channel_connection.proto\032(googl" - + "e/cloud/eventarc/v1/discovery.proto\032&goo" - + "gle/cloud/eventarc/v1/trigger.proto\032#goo" - + "gle/longrunning/operations.proto\032 google" - + "/protobuf/field_mask.proto\032\037google/proto" - + "buf/timestamp.proto\"J\n\021GetTriggerRequest" - + "\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037eventarc.googlea" - + "pis.com/Trigger\"\207\001\n\023ListTriggersRequest\022" - + "7\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037eventarc.google" - + "apis.com/Trigger\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" - + "age_token\030\003 \001(\t\022\020\n\010order_by\030\004 \001(\t\"y\n\024Lis" - + "tTriggersResponse\0223\n\010triggers\030\001 \003(\0132!.go" - + "ogle.cloud.eventarc.v1.Trigger\022\027\n\017next_p" - + "age_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\275\001\n" - + "\024CreateTriggerRequest\0227\n\006parent\030\001 \001(\tB\'\340" - + "A\002\372A!\022\037eventarc.googleapis.com/Trigger\0227" - + "\n\007trigger\030\002 \001(\0132!.google.cloud.eventarc." - + "v1.TriggerB\003\340A\002\022\027\n\ntrigger_id\030\003 \001(\tB\003\340A\002" - + "\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"\256\001\n\024UpdateT" - + "riggerRequest\0222\n\007trigger\030\001 \001(\0132!.google." - + "cloud.eventarc.v1.Trigger\022/\n\013update_mask" - + "\030\002 \001(\0132\032.google.protobuf.FieldMask\022\025\n\ral" - + "low_missing\030\003 \001(\010\022\032\n\rvalidate_only\030\004 \001(\010" - + "B\003\340A\002\"\216\001\n\024DeleteTriggerRequest\0225\n\004name\030\001" - + " \001(\tB\'\340A\002\372A!\n\037eventarc.googleapis.com/Tr" - + "igger\022\014\n\004etag\030\002 \001(\t\022\025\n\rallow_missing\030\003 \001" - + "(\010\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"J\n\021GetCha" - + "nnelRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037event" - + "arc.googleapis.com/Channel\"\207\001\n\023ListChann" - + "elsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037even" - + "tarc.googleapis.com/Channel\022\021\n\tpage_size" - + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\020\n\010order_by\030\004" - + " \001(\t\"y\n\024ListChannelsResponse\0223\n\010channels" - + "\030\001 \003(\0132!.google.cloud.eventarc.v1.Channe" - + "l\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachabl" - + "e\030\003 \003(\t\"\275\001\n\024CreateChannelRequest\0227\n\006pare" - + "nt\030\001 \001(\tB\'\340A\002\372A!\022\037eventarc.googleapis.co" - + "m/Channel\0227\n\007channel\030\002 \001(\0132!.google.clou" - + "d.eventarc.v1.ChannelB\003\340A\002\022\027\n\nchannel_id" - + "\030\003 \001(\tB\003\340A\002\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"" - + "\227\001\n\024UpdateChannelRequest\0222\n\007channel\030\001 \001(" - + "\0132!.google.cloud.eventarc.v1.Channel\022/\n\013" - + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" - + "dMask\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\002\"i\n\024Del" - + "eteChannelRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n" - + "\037eventarc.googleapis.com/Channel\022\032\n\rvali" - + "date_only\030\002 \001(\010B\003\340A\002\"L\n\022GetProviderReque" - + "st\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n eventarc.googl" - + "eapis.com/Provider\"\231\001\n\024ListProvidersRequ" - + "est\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 eventarc.go" - + "ogleapis.com/Provider\022\021\n\tpage_size\030\002 \001(\005" - + "\022\022\n\npage_token\030\003 \001(\t\022\020\n\010order_by\030\004 \001(\t\022\016" - + "\n\006filter\030\005 \001(\t\"|\n\025ListProvidersResponse\022" - + "5\n\tproviders\030\001 \003(\0132\".google.cloud.eventa" - + "rc.v1.Provider\022\027\n\017next_page_token\030\002 \001(\t\022" - + "\023\n\013unreachable\030\003 \003(\t\"^\n\033GetChannelConnec" + + "e/cloud/eventarc/v1/discovery.proto\0324goo" + + "gle/cloud/eventarc/v1/google_channel_con" + + "fig.proto\032&google/cloud/eventarc/v1/trig" + + "ger.proto\032#google/longrunning/operations" + + ".proto\032 google/protobuf/field_mask.proto" + + "\032\037google/protobuf/timestamp.proto\"J\n\021Get" + + "TriggerRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037ev" + + "entarc.googleapis.com/Trigger\"\227\001\n\023ListTr" + + "iggersRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037e" + + "ventarc.googleapis.com/Trigger\022\021\n\tpage_s" + + "ize\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\020\n\010order_b" + + "y\030\004 \001(\t\022\016\n\006filter\030\005 \001(\t\"y\n\024ListTriggersR" + + "esponse\0223\n\010triggers\030\001 \003(\0132!.google.cloud" + + ".eventarc.v1.Trigger\022\027\n\017next_page_token\030" + + "\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\275\001\n\024CreateTri" + + "ggerRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037eve" + + "ntarc.googleapis.com/Trigger\0227\n\007trigger\030" + + "\002 \001(\0132!.google.cloud.eventarc.v1.Trigger" + + "B\003\340A\002\022\027\n\ntrigger_id\030\003 \001(\tB\003\340A\002\022\032\n\rvalida" + + "te_only\030\004 \001(\010B\003\340A\002\"\256\001\n\024UpdateTriggerRequ" + + "est\0222\n\007trigger\030\001 \001(\0132!.google.cloud.even" + + "tarc.v1.Trigger\022/\n\013update_mask\030\002 \001(\0132\032.g" + + "oogle.protobuf.FieldMask\022\025\n\rallow_missin" + + "g\030\003 \001(\010\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"\216\001\n\024" + + "DeleteTriggerRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372" + + "A!\n\037eventarc.googleapis.com/Trigger\022\014\n\004e" + + "tag\030\002 \001(\t\022\025\n\rallow_missing\030\003 \001(\010\022\032\n\rvali" + + "date_only\030\004 \001(\010B\003\340A\002\"J\n\021GetChannelReques" + + "t\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037eventarc.google" + + "apis.com/Channel\"\207\001\n\023ListChannelsRequest" + + "\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037eventarc.googl" + + "eapis.com/Channel\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\022\020\n\010order_by\030\004 \001(\t\"y\n\024Li" + + "stChannelsResponse\0223\n\010channels\030\001 \003(\0132!.g" + + "oogle.cloud.eventarc.v1.Channel\022\027\n\017next_" + + "page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\275\001" + + "\n\024CreateChannelRequest\0227\n\006parent\030\001 \001(\tB\'" + + "\340A\002\372A!\022\037eventarc.googleapis.com/Channel\022" + + "7\n\007channel\030\002 \001(\0132!.google.cloud.eventarc" + + ".v1.ChannelB\003\340A\002\022\027\n\nchannel_id\030\003 \001(\tB\003\340A" + + "\002\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"\227\001\n\024Update" + + "ChannelRequest\0222\n\007channel\030\001 \001(\0132!.google" + + ".cloud.eventarc.v1.Channel\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\022\032\n\rv" + + "alidate_only\030\003 \001(\010B\003\340A\002\"i\n\024DeleteChannel" + + "Request\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037eventarc." + + "googleapis.com/Channel\022\032\n\rvalidate_only\030" + + "\002 \001(\010B\003\340A\002\"L\n\022GetProviderRequest\0226\n\004name" + + "\030\001 \001(\tB(\340A\002\372A\"\n eventarc.googleapis.com/" + + "Provider\"\231\001\n\024ListProvidersRequest\0228\n\006par" + + "ent\030\001 \001(\tB(\340A\002\372A\"\022 eventarc.googleapis.c" + + "om/Provider\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_t" + + "oken\030\003 \001(\t\022\020\n\010order_by\030\004 \001(\t\022\016\n\006filter\030\005" + + " \001(\t\"|\n\025ListProvidersResponse\0225\n\tprovide" + + "rs\030\001 \003(\0132\".google.cloud.eventarc.v1.Prov" + + "ider\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreach" + + "able\030\003 \003(\t\"^\n\033GetChannelConnectionReques" + + "t\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)eventarc.google" + + "apis.com/ChannelConnection\"\211\001\n\035ListChann" + + "elConnectionsRequest\022A\n\006parent\030\001 \001(\tB1\340A" + + "\002\372A+\022)eventarc.googleapis.com/ChannelCon" + + "nection\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token" + + "\030\003 \001(\t\"\230\001\n\036ListChannelConnectionsRespons" + + "e\022H\n\023channel_connections\030\001 \003(\0132+.google." + + "cloud.eventarc.v1.ChannelConnection\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(" + + "\t\"\325\001\n\036CreateChannelConnectionRequest\022A\n\006" + + "parent\030\001 \001(\tB1\340A\002\372A+\022)eventarc.googleapi" + + "s.com/ChannelConnection\022L\n\022channel_conne" + + "ction\030\002 \001(\0132+.google.cloud.eventarc.v1.C" + + "hannelConnectionB\003\340A\002\022\"\n\025channel_connect" + + "ion_id\030\003 \001(\tB\003\340A\002\"a\n\036DeleteChannelConnec" + "tionRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)event" - + "arc.googleapis.com/ChannelConnection\"\211\001\n" - + "\035ListChannelConnectionsRequest\022A\n\006parent" - + "\030\001 \001(\tB1\340A\002\372A+\022)eventarc.googleapis.com/" - + "ChannelConnection\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" - + "page_token\030\003 \001(\t\"\230\001\n\036ListChannelConnecti" - + "onsResponse\022H\n\023channel_connections\030\001 \003(\013" - + "2+.google.cloud.eventarc.v1.ChannelConne" - + "ction\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreac" - + "hable\030\003 \003(\t\"\325\001\n\036CreateChannelConnectionR" - + "equest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+\022)eventarc" - + ".googleapis.com/ChannelConnection\022L\n\022cha" - + "nnel_connection\030\002 \001(\0132+.google.cloud.eve" - + "ntarc.v1.ChannelConnectionB\003\340A\002\022\"\n\025chann" - + "el_connection_id\030\003 \001(\tB\003\340A\002\"a\n\036DeleteCha" - + "nnelConnectionRequest\022?\n\004name\030\001 \001(\tB1\340A\002" - + "\372A+\n)eventarc.googleapis.com/ChannelConn" - + "ection\"\200\002\n\021OperationMetadata\0224\n\013create_t" - + "ime\030\001 \001(\0132\032.google.protobuf.TimestampB\003\340" - + "A\003\0221\n\010end_time\030\002 \001(\0132\032.google.protobuf.T" - + "imestampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004ve" - + "rb\030\004 \001(\tB\003\340A\003\022\033\n\016status_message\030\005 \001(\tB\003\340" - + "A\003\022#\n\026requested_cancellation\030\006 \001(\010B\003\340A\003\022" - + "\030\n\013api_version\030\007 \001(\tB\003\340A\0032\354\031\n\010Eventarc\022\231" - + "\001\n\nGetTrigger\022+.google.cloud.eventarc.v1" - + ".GetTriggerRequest\032!.google.cloud.eventa" - + "rc.v1.Trigger\";\202\323\344\223\002.\022,/v1/{name=project" - + "s/*/locations/*/triggers/*}\332A\004name\022\254\001\n\014L" - + "istTriggers\022-.google.cloud.eventarc.v1.L" - + "istTriggersRequest\032..google.cloud.eventa" - + "rc.v1.ListTriggersResponse\"=\202\323\344\223\002.\022,/v1/" - + "{parent=projects/*/locations/*}/triggers" - + "\332A\006parent\022\330\001\n\rCreateTrigger\022..google.clo" - + "ud.eventarc.v1.CreateTriggerRequest\032\035.go" - + "ogle.longrunning.Operation\"x\202\323\344\223\0027\",/v1/" - + "{parent=projects/*/locations/*}/triggers" - + ":\007trigger\332A\031parent,trigger,trigger_id\312A\034" - + "\n\007Trigger\022\021OperationMetadata\022\351\001\n\rUpdateT" - + "rigger\022..google.cloud.eventarc.v1.Update" + + "arc.googleapis.com/ChannelConnection\"\246\001\n" + + " UpdateGoogleChannelConfigRequest\022Q\n\025goo" + + "gle_channel_config\030\001 \001(\0132-.google.cloud." + + "eventarc.v1.GoogleChannelConfigB\003\340A\002\022/\n\013" + + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" + + "dMask\"b\n\035GetGoogleChannelConfigRequest\022A" + + "\n\004name\030\001 \001(\tB3\340A\002\372A-\n+eventarc.googleapi" + + "s.com/GoogleChannelConfig\"\200\002\n\021OperationM" + + "etadata\0224\n\013create_time\030\001 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132" + + "\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006targ" + + "et\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016stat" + + "us_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_cance" + + "llation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB" + + "\003\340A\0032\317\035\n\010Eventarc\022\231\001\n\nGetTrigger\022+.googl" + + "e.cloud.eventarc.v1.GetTriggerRequest\032!." + + "google.cloud.eventarc.v1.Trigger\";\202\323\344\223\002." + + "\022,/v1/{name=projects/*/locations/*/trigg" + + "ers/*}\332A\004name\022\254\001\n\014ListTriggers\022-.google." + + "cloud.eventarc.v1.ListTriggersRequest\032.." + + "google.cloud.eventarc.v1.ListTriggersRes" + + "ponse\"=\202\323\344\223\002.\022,/v1/{parent=projects/*/lo" + + "cations/*}/triggers\332A\006parent\022\330\001\n\rCreateT" + + "rigger\022..google.cloud.eventarc.v1.Create" + "TriggerRequest\032\035.google.longrunning.Oper" - + "ation\"\210\001\202\323\344\223\002?24/v1/{trigger.name=projec" - + "ts/*/locations/*/triggers/*}:\007trigger\332A!" - + "trigger,update_mask,allow_missing\312A\034\n\007Tr" - + "igger\022\021OperationMetadata\022\310\001\n\rDeleteTrigg" - + "er\022..google.cloud.eventarc.v1.DeleteTrig" - + "gerRequest\032\035.google.longrunning.Operatio" - + "n\"h\202\323\344\223\002.*,/v1/{name=projects/*/location" - + "s/*/triggers/*}\332A\022name,allow_missing\312A\034\n" - + "\007Trigger\022\021OperationMetadata\022\231\001\n\nGetChann" - + "el\022+.google.cloud.eventarc.v1.GetChannel" - + "Request\032!.google.cloud.eventarc.v1.Chann" - + "el\";\202\323\344\223\002.\022,/v1/{name=projects/*/locatio" - + "ns/*/channels/*}\332A\004name\022\254\001\n\014ListChannels" - + "\022-.google.cloud.eventarc.v1.ListChannels" - + "Request\032..google.cloud.eventarc.v1.ListC" - + "hannelsResponse\"=\202\323\344\223\002.\022,/v1/{parent=pro" - + "jects/*/locations/*}/channels\332A\006parent\022\330" - + "\001\n\rCreateChannel\022..google.cloud.eventarc" - + ".v1.CreateChannelRequest\032\035.google.longru" - + "nning.Operation\"x\202\323\344\223\0027\",/v1/{parent=pro" - + "jects/*/locations/*}/channels:\007channel\332A" - + "\031parent,channel,channel_id\312A\034\n\007Channel\022\021" - + "OperationMetadata\022\332\001\n\rUpdateChannel\022..go" - + "ogle.cloud.eventarc.v1.UpdateChannelRequ" - + "est\032\035.google.longrunning.Operation\"z\202\323\344\223" - + "\002?24/v1/{channel.name=projects/*/locatio" - + "ns/*/channels/*}:\007channel\332A\023channel,upda" - + "te_mask\312A\034\n\007Channel\022\021OperationMetadata\022\272" - + "\001\n\rDeleteChannel\022..google.cloud.eventarc" - + ".v1.DeleteChannelRequest\032\035.google.longru" - + "nning.Operation\"Z\202\323\344\223\002.*,/v1/{name=proje" - + "cts/*/locations/*/channels/*}\332A\004name\312A\034\n" - + "\007Channel\022\021OperationMetadata\022\235\001\n\013GetProvi" - + "der\022,.google.cloud.eventarc.v1.GetProvid" - + "erRequest\032\".google.cloud.eventarc.v1.Pro" - + "vider\"<\202\323\344\223\002/\022-/v1/{name=projects/*/loca" - + "tions/*/providers/*}\332A\004name\022\260\001\n\rListProv" - + "iders\022..google.cloud.eventarc.v1.ListPro" - + "vidersRequest\032/.google.cloud.eventarc.v1" - + ".ListProvidersResponse\">\202\323\344\223\002/\022-/v1/{par" - + "ent=projects/*/locations/*}/providers\332A\006" - + "parent\022\301\001\n\024GetChannelConnection\0225.google" - + ".cloud.eventarc.v1.GetChannelConnectionR" - + "equest\032+.google.cloud.eventarc.v1.Channe" - + "lConnection\"E\202\323\344\223\0028\0226/v1/{name=projects/" - + "*/locations/*/channelConnections/*}\332A\004na" - + "me\022\324\001\n\026ListChannelConnections\0227.google.c" - + "loud.eventarc.v1.ListChannelConnectionsR" - + "equest\0328.google.cloud.eventarc.v1.ListCh" - + "annelConnectionsResponse\"G\202\323\344\223\0028\0226/v1/{p" - + "arent=projects/*/locations/*}/channelCon" - + "nections\332A\006parent\022\242\002\n\027CreateChannelConne" - + "ction\0228.google.cloud.eventarc.v1.CreateC" - + "hannelConnectionRequest\032\035.google.longrun" - + "ning.Operation\"\255\001\202\323\344\223\002L\"6/v1/{parent=pro" - + "jects/*/locations/*}/channelConnections:" - + "\022channel_connection\332A/parent,channel_con" - + "nection,channel_connection_id\312A&\n\021Channe" - + "lConnection\022\021OperationMetadata\022\342\001\n\027Delet" - + "eChannelConnection\0228.google.cloud.eventa" - + "rc.v1.DeleteChannelConnectionRequest\032\035.g" - + "oogle.longrunning.Operation\"n\202\323\344\223\0028*6/v1" - + "/{name=projects/*/locations/*/channelCon" - + "nections/*}\332A\004name\312A&\n\021ChannelConnection" - + "\022\021OperationMetadata\032K\312A\027eventarc.googlea" - + "pis.com\322A.https://www.googleapis.com/aut" - + "h/cloud-platformB\305\001\n\034com.google.cloud.ev" - + "entarc.v1B\rEventarcProtoP\001Z@google.golan" - + "g.org/genproto/googleapis/cloud/eventarc" - + "/v1;eventarc\252\002\030Google.Cloud.Eventarc.V1\312" - + "\002\030Google\\Cloud\\Eventarc\\V1\352\002\033Google::Clo" - + "ud::Eventarc::V1b\006proto3" + + "ation\"x\202\323\344\223\0027\",/v1/{parent=projects/*/lo" + + "cations/*}/triggers:\007trigger\332A\031parent,tr" + + "igger,trigger_id\312A\034\n\007Trigger\022\021OperationM" + + "etadata\022\351\001\n\rUpdateTrigger\022..google.cloud" + + ".eventarc.v1.UpdateTriggerRequest\032\035.goog" + + "le.longrunning.Operation\"\210\001\202\323\344\223\002?24/v1/{" + + "trigger.name=projects/*/locations/*/trig" + + "gers/*}:\007trigger\332A!trigger,update_mask,a" + + "llow_missing\312A\034\n\007Trigger\022\021OperationMetad" + + "ata\022\310\001\n\rDeleteTrigger\022..google.cloud.eve" + + "ntarc.v1.DeleteTriggerRequest\032\035.google.l" + + "ongrunning.Operation\"h\202\323\344\223\002.*,/v1/{name=" + + "projects/*/locations/*/triggers/*}\332A\022nam" + + "e,allow_missing\312A\034\n\007Trigger\022\021OperationMe" + + "tadata\022\231\001\n\nGetChannel\022+.google.cloud.eve" + + "ntarc.v1.GetChannelRequest\032!.google.clou" + + "d.eventarc.v1.Channel\";\202\323\344\223\002.\022,/v1/{name" + + "=projects/*/locations/*/channels/*}\332A\004na" + + "me\022\254\001\n\014ListChannels\022-.google.cloud.event" + + "arc.v1.ListChannelsRequest\032..google.clou" + + "d.eventarc.v1.ListChannelsResponse\"=\202\323\344\223" + + "\002.\022,/v1/{parent=projects/*/locations/*}/" + + "channels\332A\006parent\022\330\001\n\rCreateChannel\022..go" + + "ogle.cloud.eventarc.v1.CreateChannelRequ" + + "est\032\035.google.longrunning.Operation\"x\202\323\344\223" + + "\0027\",/v1/{parent=projects/*/locations/*}/" + + "channels:\007channel\332A\031parent,channel,chann" + + "el_id\312A\034\n\007Channel\022\021OperationMetadata\022\332\001\n" + + "\rUpdateChannel\022..google.cloud.eventarc.v" + + "1.UpdateChannelRequest\032\035.google.longrunn" + + "ing.Operation\"z\202\323\344\223\002?24/v1/{channel.name" + + "=projects/*/locations/*/channels/*}:\007cha" + + "nnel\332A\023channel,update_mask\312A\034\n\007Channel\022\021" + + "OperationMetadata\022\272\001\n\rDeleteChannel\022..go" + + "ogle.cloud.eventarc.v1.DeleteChannelRequ" + + "est\032\035.google.longrunning.Operation\"Z\202\323\344\223" + + "\002.*,/v1/{name=projects/*/locations/*/cha" + + "nnels/*}\332A\004name\312A\034\n\007Channel\022\021OperationMe" + + "tadata\022\235\001\n\013GetProvider\022,.google.cloud.ev" + + "entarc.v1.GetProviderRequest\032\".google.cl" + + "oud.eventarc.v1.Provider\"<\202\323\344\223\002/\022-/v1/{n" + + "ame=projects/*/locations/*/providers/*}\332" + + "A\004name\022\260\001\n\rListProviders\022..google.cloud." + + "eventarc.v1.ListProvidersRequest\032/.googl" + + "e.cloud.eventarc.v1.ListProvidersRespons" + + "e\">\202\323\344\223\002/\022-/v1/{parent=projects/*/locati" + + "ons/*}/providers\332A\006parent\022\301\001\n\024GetChannel" + + "Connection\0225.google.cloud.eventarc.v1.Ge" + + "tChannelConnectionRequest\032+.google.cloud" + + ".eventarc.v1.ChannelConnection\"E\202\323\344\223\0028\0226" + + "/v1/{name=projects/*/locations/*/channel" + + "Connections/*}\332A\004name\022\324\001\n\026ListChannelCon" + + "nections\0227.google.cloud.eventarc.v1.List" + + "ChannelConnectionsRequest\0328.google.cloud" + + ".eventarc.v1.ListChannelConnectionsRespo" + + "nse\"G\202\323\344\223\0028\0226/v1/{parent=projects/*/loca" + + "tions/*}/channelConnections\332A\006parent\022\242\002\n" + + "\027CreateChannelConnection\0228.google.cloud." + + "eventarc.v1.CreateChannelConnectionReque" + + "st\032\035.google.longrunning.Operation\"\255\001\202\323\344\223" + + "\002L\"6/v1/{parent=projects/*/locations/*}/" + + "channelConnections:\022channel_connection\332A" + + "/parent,channel_connection,channel_conne" + + "ction_id\312A&\n\021ChannelConnection\022\021Operatio" + + "nMetadata\022\342\001\n\027DeleteChannelConnection\0228." + + "google.cloud.eventarc.v1.DeleteChannelCo" + + "nnectionRequest\032\035.google.longrunning.Ope" + + "ration\"n\202\323\344\223\0028*6/v1/{name=projects/*/loc" + + "ations/*/channelConnections/*}\332A\004name\312A&" + + "\n\021ChannelConnection\022\021OperationMetadata\022\306" + + "\001\n\026GetGoogleChannelConfig\0227.google.cloud" + + ".eventarc.v1.GetGoogleChannelConfigReque" + + "st\032-.google.cloud.eventarc.v1.GoogleChan" + + "nelConfig\"D\202\323\344\223\0027\0225/v1/{name=projects/*/" + + "locations/*/googleChannelConfig}\332A\004name\022" + + "\227\002\n\031UpdateGoogleChannelConfig\022:.google.c" + + "loud.eventarc.v1.UpdateGoogleChannelConf" + + "igRequest\032-.google.cloud.eventarc.v1.Goo" + + "gleChannelConfig\"\216\001\202\323\344\223\002d2K/v1/{google_c" + + "hannel_config.name=projects/*/locations/" + + "*/googleChannelConfig}:\025google_channel_c" + + "onfig\332A!google_channel_config,update_mas" + + "k\032K\312A\027eventarc.googleapis.com\322A.https://" + + "www.googleapis.com/auth/cloud-platformB\305" + + "\001\n\034com.google.cloud.eventarc.v1B\rEventar" + + "cProtoP\001Z@google.golang.org/genproto/goo" + + "gleapis/cloud/eventarc/v1;eventarc\252\002\030Goo" + + "gle.Cloud.Eventarc.V1\312\002\030Google\\Cloud\\Eve" + + "ntarc\\V1\352\002\033Google::Cloud::Eventarc::V1b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -306,6 +335,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.eventarc.v1.ChannelProto.getDescriptor(), com.google.cloud.eventarc.v1.ChannelConnectionProto.getDescriptor(), com.google.cloud.eventarc.v1.DiscoveryProto.getDescriptor(), + com.google.cloud.eventarc.v1.GoogleChannelConfigProto.getDescriptor(), com.google.cloud.eventarc.v1.TriggerProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), @@ -325,7 +355,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_ListTriggersRequest_descriptor, new java.lang.String[] { - "Parent", "PageSize", "PageToken", "OrderBy", + "Parent", "PageSize", "PageToken", "OrderBy", "Filter", }); internal_static_google_cloud_eventarc_v1_ListTriggersResponse_descriptor = getDescriptor().getMessageTypes().get(2); @@ -471,8 +501,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", }); - internal_static_google_cloud_eventarc_v1_OperationMetadata_descriptor = + internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_descriptor = getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_descriptor, + new java.lang.String[] { + "GoogleChannelConfig", "UpdateMask", + }); + internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_eventarc_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_eventarc_v1_OperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_OperationMetadata_descriptor, @@ -503,6 +549,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.eventarc.v1.ChannelProto.getDescriptor(); com.google.cloud.eventarc.v1.ChannelConnectionProto.getDescriptor(); com.google.cloud.eventarc.v1.DiscoveryProto.getDescriptor(); + com.google.cloud.eventarc.v1.GoogleChannelConfigProto.getDescriptor(); com.google.cloud.eventarc.v1.TriggerProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetGoogleChannelConfigRequest.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetGoogleChannelConfigRequest.java new file mode 100644 index 000000000000..d72e3f2c9429 --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetGoogleChannelConfigRequest.java @@ -0,0 +1,630 @@ +/* + * 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/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * The request message for the GetGoogleChannelConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.GetGoogleChannelConfigRequest} + */ +public final class GetGoogleChannelConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) + GetGoogleChannelConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetGoogleChannelConfigRequest.newBuilder() to construct. + private GetGoogleChannelConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetGoogleChannelConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetGoogleChannelConfigRequest(); + } + + @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.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.class, + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the config to get.
+   * 
+ * + * + * 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 config to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest other = + (com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest 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.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest 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.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest 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.cloud.eventarc.v1.GetGoogleChannelConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest 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.cloud.eventarc.v1.GetGoogleChannelConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for the GetGoogleChannelConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.GetGoogleChannelConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.class, + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetGoogleChannelConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest build() { + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest buildPartial() { + com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest result = + new com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) { + return mergeFrom((com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest other) { + if (other == com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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 + 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 config to get.
+     * 
+ * + * + * 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 config to get.
+     * 
+ * + * + * 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 config to get.
+     * 
+ * + * + * 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 config to get.
+     * 
+ * + * + * 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 config to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) + private static final com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest(); + } + + public static com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetGoogleChannelConfigRequest 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.cloud.eventarc.v1.GetGoogleChannelConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetGoogleChannelConfigRequestOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetGoogleChannelConfigRequestOrBuilder.java new file mode 100644 index 000000000000..537002ba14d6 --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetGoogleChannelConfigRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +public interface GetGoogleChannelConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.GetGoogleChannelConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the config to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the config to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfig.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfig.java new file mode 100644 index 000000000000..445f59681dca --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfig.java @@ -0,0 +1,1127 @@ +/* + * 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/cloud/eventarc/v1/google_channel_config.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * A GoogleChannelConfig is a resource that stores the custom settings
+ * respected by Eventarc first-party triggers in the matching region.
+ * Once configured, first-party event data will be protected
+ * using the specified custom managed encryption key instead of Google-managed
+ * encryption keys.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.GoogleChannelConfig} + */ +public final class GoogleChannelConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.GoogleChannelConfig) + GoogleChannelConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use GoogleChannelConfig.newBuilder() to construct. + private GoogleChannelConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GoogleChannelConfig() { + name_ = ""; + cryptoKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GoogleChannelConfig(); + } + + @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.cloud.eventarc.v1.GoogleChannelConfigProto + .internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.GoogleChannelConfigProto + .internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.GoogleChannelConfig.class, + com.google.cloud.eventarc.v1.GoogleChannelConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the config. Must be in the format of,
+   * `projects/{project}/locations/{location}/googleChannelConfig`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the config. Must be in the format of,
+   * `projects/{project}/locations/{location}/googleChannelConfig`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int CRYPTO_KEY_NAME_FIELD_NUMBER = 7; + private volatile java.lang.Object cryptoKeyName_; + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The cryptoKeyName. + */ + @java.lang.Override + public java.lang.String getCryptoKeyName() { + java.lang.Object ref = cryptoKeyName_; + 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(); + cryptoKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cryptoKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCryptoKeyNameBytes() { + java.lang.Object ref = cryptoKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cryptoKeyName_ = 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 (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cryptoKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, cryptoKeyName_); + } + 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 (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cryptoKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, cryptoKeyName_); + } + 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.cloud.eventarc.v1.GoogleChannelConfig)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.GoogleChannelConfig other = + (com.google.cloud.eventarc.v1.GoogleChannelConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getCryptoKeyName().equals(other.getCryptoKeyName())) 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 (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + CRYPTO_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCryptoKeyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig 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.cloud.eventarc.v1.GoogleChannelConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig 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.cloud.eventarc.v1.GoogleChannelConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig 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.cloud.eventarc.v1.GoogleChannelConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig 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.cloud.eventarc.v1.GoogleChannelConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A GoogleChannelConfig is a resource that stores the custom settings
+   * respected by Eventarc first-party triggers in the matching region.
+   * Once configured, first-party event data will be protected
+   * using the specified custom managed encryption key instead of Google-managed
+   * encryption keys.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.GoogleChannelConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.GoogleChannelConfig) + com.google.cloud.eventarc.v1.GoogleChannelConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.GoogleChannelConfigProto + .internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.GoogleChannelConfigProto + .internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.GoogleChannelConfig.class, + com.google.cloud.eventarc.v1.GoogleChannelConfig.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.GoogleChannelConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + cryptoKeyName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.GoogleChannelConfigProto + .internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GoogleChannelConfig getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.GoogleChannelConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GoogleChannelConfig build() { + com.google.cloud.eventarc.v1.GoogleChannelConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GoogleChannelConfig buildPartial() { + com.google.cloud.eventarc.v1.GoogleChannelConfig result = + new com.google.cloud.eventarc.v1.GoogleChannelConfig(this); + result.name_ = name_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.cryptoKeyName_ = cryptoKeyName_; + 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.cloud.eventarc.v1.GoogleChannelConfig) { + return mergeFrom((com.google.cloud.eventarc.v1.GoogleChannelConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.GoogleChannelConfig other) { + if (other == com.google.cloud.eventarc.v1.GoogleChannelConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getCryptoKeyName().isEmpty()) { + cryptoKeyName_ = other.cryptoKeyName_; + 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 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 58: + { + cryptoKeyName_ = input.readStringRequireUtf8(); + + break; + } // case 58 + 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 resource name of the config. Must be in the format of,
+     * `projects/{project}/locations/{location}/googleChannelConfig`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the config. Must be in the format of,
+     * `projects/{project}/locations/{location}/googleChannelConfig`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the config. Must be in the format of,
+     * `projects/{project}/locations/{location}/googleChannelConfig`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the config. Must be in the format of,
+     * `projects/{project}/locations/{location}/googleChannelConfig`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the config. Must be in the format of,
+     * `projects/{project}/locations/{location}/googleChannelConfig`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object cryptoKeyName_ = ""; + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The cryptoKeyName. + */ + public java.lang.String getCryptoKeyName() { + java.lang.Object ref = cryptoKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cryptoKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cryptoKeyName. + */ + public com.google.protobuf.ByteString getCryptoKeyNameBytes() { + java.lang.Object ref = cryptoKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cryptoKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The cryptoKeyName to set. + * @return This builder for chaining. + */ + public Builder setCryptoKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cryptoKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearCryptoKeyName() { + + cryptoKeyName_ = getDefaultInstance().getCryptoKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt their event data.
+     * It must match the pattern
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for cryptoKeyName to set. + * @return This builder for chaining. + */ + public Builder setCryptoKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cryptoKeyName_ = 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.cloud.eventarc.v1.GoogleChannelConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.GoogleChannelConfig) + private static final com.google.cloud.eventarc.v1.GoogleChannelConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.GoogleChannelConfig(); + } + + public static com.google.cloud.eventarc.v1.GoogleChannelConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GoogleChannelConfig 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.cloud.eventarc.v1.GoogleChannelConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigName.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigName.java new file mode 100644 index 000000000000..fe98fea92bf3 --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigName.java @@ -0,0 +1,193 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class GoogleChannelConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/googleChannelConfig"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected GoogleChannelConfigName() { + project = null; + location = null; + } + + private GoogleChannelConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static GoogleChannelConfigName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static GoogleChannelConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "GoogleChannelConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (GoogleChannelConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + GoogleChannelConfigName that = ((GoogleChannelConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}/googleChannelConfig. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(GoogleChannelConfigName googleChannelConfigName) { + this.project = googleChannelConfigName.project; + this.location = googleChannelConfigName.location; + } + + public GoogleChannelConfigName build() { + return new GoogleChannelConfigName(this); + } + } +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigOrBuilder.java new file mode 100644 index 000000000000..fec57b0b7aec --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigOrBuilder.java @@ -0,0 +1,125 @@ +/* + * 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/cloud/eventarc/v1/google_channel_config.proto + +package com.google.cloud.eventarc.v1; + +public interface GoogleChannelConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.GoogleChannelConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the config. Must be in the format of,
+   * `projects/{project}/locations/{location}/googleChannelConfig`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the config. Must be in the format of,
+   * `projects/{project}/locations/{location}/googleChannelConfig`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The cryptoKeyName. + */ + java.lang.String getCryptoKeyName(); + /** + * + * + *
+   * Optional. Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt their event data.
+   * It must match the pattern
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * + * string crypto_key_name = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cryptoKeyName. + */ + com.google.protobuf.ByteString getCryptoKeyNameBytes(); +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigProto.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigProto.java new file mode 100644 index 000000000000..60528967f07c --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GoogleChannelConfigProto.java @@ -0,0 +1,95 @@ +/* + * 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/cloud/eventarc/v1/google_channel_config.proto + +package com.google.cloud.eventarc.v1; + +public final class GoogleChannelConfigProto { + private GoogleChannelConfigProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/eventarc/v1/google_channe" + + "l_config.proto\022\030google.cloud.eventarc.v1" + + "\032\037google/api/field_behavior.proto\032\031googl" + + "e/api/resource.proto\032\037google/protobuf/ti" + + "mestamp.proto\"\247\002\n\023GoogleChannelConfig\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\0224\n\013update_time\030\006 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\022B\n\017crypto" + + "_key_name\030\007 \001(\tB)\340A\001\372A#\n!cloudkms.google" + + "apis.com/CryptoKey:\202\001\352A\177\n+eventarc.googl" + + "eapis.com/GoogleChannelConfig\022;projects/" + + "{project}/locations/{location}/googleCha" + + "nnelConfig2\023googleChannelConfigB\313\002\n\034com." + + "google.cloud.eventarc.v1B\030GoogleChannelC" + + "onfigProtoP\001Z@google.golang.org/genproto" + + "/googleapis/cloud/eventarc/v1;eventarc\252\002" + + "\030Google.Cloud.Eventarc.V1\312\002\030Google\\Cloud" + + "\\Eventarc\\V1\352\002\033Google::Cloud::Eventarc::" + + "V1\352Ax\n!cloudkms.googleapis.com/CryptoKey" + + "\022Sprojects/{project}/locations/{location" + + "}/keyRings/{key_ring}/cryptoKeys/{crypto" + + "_key}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_eventarc_v1_GoogleChannelConfig_descriptor, + new java.lang.String[] { + "Name", "UpdateTime", "CryptoKeyName", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponse.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponse.java index 80353f1c1c88..9d8a5317ed11 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponse.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponse.java @@ -152,7 +152,7 @@ public com.google.cloud.eventarc.v1.ChannelConnectionOrBuilder getChannelConnect * * *
-   * A page token that can be sent to ListChannelConnections to request the
+   * A page token that can be sent to `ListChannelConnections` to request the
    * next page.
    * If this is empty, then there are no more pages.
    * 
@@ -177,7 +177,7 @@ public java.lang.String getNextPageToken() { * * *
-   * A page token that can be sent to ListChannelConnections to request the
+   * A page token that can be sent to `ListChannelConnections` to request the
    * next page.
    * If this is empty, then there are no more pages.
    * 
@@ -1086,7 +1086,7 @@ public com.google.cloud.eventarc.v1.ChannelConnection.Builder addChannelConnecti * * *
-     * A page token that can be sent to ListChannelConnections to request the
+     * A page token that can be sent to `ListChannelConnections` to request the
      * next page.
      * If this is empty, then there are no more pages.
      * 
@@ -1110,7 +1110,7 @@ public java.lang.String getNextPageToken() { * * *
-     * A page token that can be sent to ListChannelConnections to request the
+     * A page token that can be sent to `ListChannelConnections` to request the
      * next page.
      * If this is empty, then there are no more pages.
      * 
@@ -1134,7 +1134,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * *
-     * A page token that can be sent to ListChannelConnections to request the
+     * A page token that can be sent to `ListChannelConnections` to request the
      * next page.
      * If this is empty, then there are no more pages.
      * 
@@ -1157,7 +1157,7 @@ public Builder setNextPageToken(java.lang.String value) { * * *
-     * A page token that can be sent to ListChannelConnections to request the
+     * A page token that can be sent to `ListChannelConnections` to request the
      * next page.
      * If this is empty, then there are no more pages.
      * 
@@ -1176,7 +1176,7 @@ public Builder clearNextPageToken() { * * *
-     * A page token that can be sent to ListChannelConnections to request the
+     * A page token that can be sent to `ListChannelConnections` to request the
      * next page.
      * If this is empty, then there are no more pages.
      * 
diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponseOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponseOrBuilder.java index 1bb4d9699565..5a66f5109514 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponseOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelConnectionsResponseOrBuilder.java @@ -84,7 +84,7 @@ public interface ListChannelConnectionsResponseOrBuilder * * *
-   * A page token that can be sent to ListChannelConnections to request the
+   * A page token that can be sent to `ListChannelConnections` to request the
    * next page.
    * If this is empty, then there are no more pages.
    * 
@@ -98,7 +98,7 @@ public interface ListChannelConnectionsResponseOrBuilder * * *
-   * A page token that can be sent to ListChannelConnections to request the
+   * A page token that can be sent to `ListChannelConnections` to request the
    * next page.
    * If this is empty, then there are no more pages.
    * 
diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponse.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponse.java index 3c8d393e01e6..c28cfb2f01c6 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponse.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponse.java @@ -144,7 +144,7 @@ public com.google.cloud.eventarc.v1.ChannelOrBuilder getChannelsOrBuilder(int in * * *
-   * A page token that can be sent to ListChannels to request the next page.
+   * A page token that can be sent to `ListChannels` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -168,7 +168,7 @@ public java.lang.String getNextPageToken() { * * *
-   * A page token that can be sent to ListChannels to request the next page.
+   * A page token that can be sent to `ListChannels` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -1043,7 +1043,7 @@ public java.util.List getChannelsB * * *
-     * A page token that can be sent to ListChannels to request the next page.
+     * A page token that can be sent to `ListChannels` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1066,7 +1066,7 @@ public java.lang.String getNextPageToken() { * * *
-     * A page token that can be sent to ListChannels to request the next page.
+     * A page token that can be sent to `ListChannels` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1089,7 +1089,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * *
-     * A page token that can be sent to ListChannels to request the next page.
+     * A page token that can be sent to `ListChannels` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1111,7 +1111,7 @@ public Builder setNextPageToken(java.lang.String value) { * * *
-     * A page token that can be sent to ListChannels to request the next page.
+     * A page token that can be sent to `ListChannels` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1129,7 +1129,7 @@ public Builder clearNextPageToken() { * * *
-     * A page token that can be sent to ListChannels to request the next page.
+     * A page token that can be sent to `ListChannels` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponseOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponseOrBuilder.java index 3778e95999b6..e6603219265a 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponseOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListChannelsResponseOrBuilder.java @@ -79,7 +79,7 @@ public interface ListChannelsResponseOrBuilder * * *
-   * A page token that can be sent to ListChannels to request the next page.
+   * A page token that can be sent to `ListChannels` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -92,7 +92,7 @@ public interface ListChannelsResponseOrBuilder * * *
-   * A page token that can be sent to ListChannels to request the next page.
+   * A page token that can be sent to `ListChannels` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java index 908b151b0b1a..3b509801e9b8 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java @@ -144,7 +144,7 @@ public com.google.cloud.eventarc.v1.ProviderOrBuilder getProvidersOrBuilder(int * * *
-   * A page token that can be sent to ListProviders to request the next page.
+   * A page token that can be sent to `ListProviders` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -168,7 +168,7 @@ public java.lang.String getNextPageToken() { * * *
-   * A page token that can be sent to ListProviders to request the next page.
+   * A page token that can be sent to `ListProviders` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -1043,7 +1043,7 @@ public java.util.List getProvider * * *
-     * A page token that can be sent to ListProviders to request the next page.
+     * A page token that can be sent to `ListProviders` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1066,7 +1066,7 @@ public java.lang.String getNextPageToken() { * * *
-     * A page token that can be sent to ListProviders to request the next page.
+     * A page token that can be sent to `ListProviders` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1089,7 +1089,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * *
-     * A page token that can be sent to ListProviders to request the next page.
+     * A page token that can be sent to `ListProviders` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1111,7 +1111,7 @@ public Builder setNextPageToken(java.lang.String value) { * * *
-     * A page token that can be sent to ListProviders to request the next page.
+     * A page token that can be sent to `ListProviders` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1129,7 +1129,7 @@ public Builder clearNextPageToken() { * * *
-     * A page token that can be sent to ListProviders to request the next page.
+     * A page token that can be sent to `ListProviders` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java index 5635e77c377b..a067c8b22b51 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java @@ -79,7 +79,7 @@ public interface ListProvidersResponseOrBuilder * * *
-   * A page token that can be sent to ListProviders to request the next page.
+   * A page token that can be sent to `ListProviders` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -92,7 +92,7 @@ public interface ListProvidersResponseOrBuilder * * *
-   * A page token that can be sent to ListProviders to request the next page.
+   * A page token that can be sent to `ListProviders` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequest.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequest.java index 938ede7537c5..f0dc3919db1f 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequest.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequest.java @@ -41,6 +41,7 @@ private ListTriggersRequest() { parent_ = ""; pageToken_ = ""; orderBy_ = ""; + filter_ = ""; } @java.lang.Override @@ -251,6 +252,59 @@ public com.google.protobuf.ByteString getOrderByBytes() { } } + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Filter field. Used to filter the Triggers to be listed. Possible filters
+   * are described in https://google.aip.dev/160. For example, using
+   * "?filter=destination:gke" would list only Triggers with a gke destination.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filter field. Used to filter the Triggers to be listed. Possible filters
+   * are described in https://google.aip.dev/160. For example, using
+   * "?filter=destination:gke" would list only Triggers with a gke destination.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -277,6 +331,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } getUnknownFields().writeTo(output); } @@ -298,6 +355,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -318,6 +378,7 @@ public boolean equals(final java.lang.Object obj) { if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getFilter().equals(other.getFilter())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -337,6 +398,8 @@ public int hashCode() { hash = (53 * hash) + getPageToken().hashCode(); hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -483,6 +546,8 @@ public Builder clear() { orderBy_ = ""; + filter_ = ""; + return this; } @@ -514,6 +579,7 @@ public com.google.cloud.eventarc.v1.ListTriggersRequest buildPartial() { result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; result.orderBy_ = orderBy_; + result.filter_ = filter_; onBuilt(); return result; } @@ -579,6 +645,10 @@ public Builder mergeFrom(com.google.cloud.eventarc.v1.ListTriggersRequest other) orderBy_ = other.orderBy_; onChanged(); } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -629,6 +699,12 @@ public Builder mergeFrom( break; } // case 34 + case 42: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1059,6 +1135,122 @@ public Builder setOrderByBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filter field. Used to filter the Triggers to be listed. Possible filters
+     * are described in https://google.aip.dev/160. For example, using
+     * "?filter=destination:gke" would list only Triggers with a gke destination.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter field. Used to filter the Triggers to be listed. Possible filters
+     * are described in https://google.aip.dev/160. For example, using
+     * "?filter=destination:gke" would list only Triggers with a gke destination.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter field. Used to filter the Triggers to be listed. Possible filters
+     * are described in https://google.aip.dev/160. For example, using
+     * "?filter=destination:gke" would list only Triggers with a gke destination.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter field. Used to filter the Triggers to be listed. Possible filters
+     * are described in https://google.aip.dev/160. For example, using
+     * "?filter=destination:gke" would list only Triggers with a gke destination.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter field. Used to filter the Triggers to be listed. Possible filters
+     * are described in https://google.aip.dev/160. For example, using
+     * "?filter=destination:gke" would list only Triggers with a gke destination.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequestOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequestOrBuilder.java index 9a7da78281c0..50fb48a5666b 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequestOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersRequestOrBuilder.java @@ -127,4 +127,33 @@ public interface ListTriggersRequestOrBuilder * @return The bytes for orderBy. */ com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Filter field. Used to filter the Triggers to be listed. Possible filters
+   * are described in https://google.aip.dev/160. For example, using
+   * "?filter=destination:gke" would list only Triggers with a gke destination.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filter field. Used to filter the Triggers to be listed. Possible filters
+   * are described in https://google.aip.dev/160. For example, using
+   * "?filter=destination:gke" would list only Triggers with a gke destination.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); } diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponse.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponse.java index f4c66b122c69..c27d36a930a8 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponse.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponse.java @@ -144,7 +144,7 @@ public com.google.cloud.eventarc.v1.TriggerOrBuilder getTriggersOrBuilder(int in * * *
-   * A page token that can be sent to ListTriggers to request the next page.
+   * A page token that can be sent to `ListTriggers` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -168,7 +168,7 @@ public java.lang.String getNextPageToken() { * * *
-   * A page token that can be sent to ListTriggers to request the next page.
+   * A page token that can be sent to `ListTriggers` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -1043,7 +1043,7 @@ public java.util.List getTriggersB * * *
-     * A page token that can be sent to ListTriggers to request the next page.
+     * A page token that can be sent to `ListTriggers` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1066,7 +1066,7 @@ public java.lang.String getNextPageToken() { * * *
-     * A page token that can be sent to ListTriggers to request the next page.
+     * A page token that can be sent to `ListTriggers` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1089,7 +1089,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * *
-     * A page token that can be sent to ListTriggers to request the next page.
+     * A page token that can be sent to `ListTriggers` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1111,7 +1111,7 @@ public Builder setNextPageToken(java.lang.String value) { * * *
-     * A page token that can be sent to ListTriggers to request the next page.
+     * A page token that can be sent to `ListTriggers` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* @@ -1129,7 +1129,7 @@ public Builder clearNextPageToken() { * * *
-     * A page token that can be sent to ListTriggers to request the next page.
+     * A page token that can be sent to `ListTriggers` to request the next page.
      * If this is empty, then there are no more pages.
      * 
* diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponseOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponseOrBuilder.java index aeec3d7606d7..25a658f80a87 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponseOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListTriggersResponseOrBuilder.java @@ -79,7 +79,7 @@ public interface ListTriggersResponseOrBuilder * * *
-   * A page token that can be sent to ListTriggers to request the next page.
+   * A page token that can be sent to `ListTriggers` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* @@ -92,7 +92,7 @@ public interface ListTriggersResponseOrBuilder * * *
-   * A page token that can be sent to ListTriggers to request the next page.
+   * A page token that can be sent to `ListTriggers` to request the next page.
    * If this is empty, then there are no more pages.
    * 
* diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/StateCondition.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/StateCondition.java new file mode 100644 index 000000000000..f1b6ba3671e3 --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/StateCondition.java @@ -0,0 +1,761 @@ +/* + * 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/cloud/eventarc/v1/trigger.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * A condition that is part of the trigger state computation.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.StateCondition} + */ +public final class StateCondition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.StateCondition) + StateConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateCondition.newBuilder() to construct. + private StateCondition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StateCondition() { + code_ = 0; + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StateCondition(); + } + + @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.cloud.eventarc.v1.TriggerProto + .internal_static_google_cloud_eventarc_v1_StateCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.TriggerProto + .internal_static_google_cloud_eventarc_v1_StateCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.StateCondition.class, + com.google.cloud.eventarc.v1.StateCondition.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * + * + *
+   * The canonical code of the condition.
+   * 
+ * + * .google.rpc.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+   * The canonical code of the condition.
+   * 
+ * + * .google.rpc.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.rpc.Code getCode() { + @SuppressWarnings("deprecation") + com.google.rpc.Code result = com.google.rpc.Code.valueOf(code_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + * + * + *
+   * Human-readable message.
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable message.
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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 (code_ != com.google.rpc.Code.OK.getNumber()) { + output.writeEnum(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != com.google.rpc.Code.OK.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + 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.cloud.eventarc.v1.StateCondition)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.StateCondition other = + (com.google.cloud.eventarc.v1.StateCondition) obj; + + if (code_ != other.code_) return false; + if (!getMessage().equals(other.getMessage())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.StateCondition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.StateCondition parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.StateCondition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.StateCondition 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.cloud.eventarc.v1.StateCondition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.StateCondition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.StateCondition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.StateCondition 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.cloud.eventarc.v1.StateCondition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.StateCondition 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.cloud.eventarc.v1.StateCondition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.StateCondition 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.cloud.eventarc.v1.StateCondition prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A condition that is part of the trigger state computation.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.StateCondition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.StateCondition) + com.google.cloud.eventarc.v1.StateConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.TriggerProto + .internal_static_google_cloud_eventarc_v1_StateCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.TriggerProto + .internal_static_google_cloud_eventarc_v1_StateCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.StateCondition.class, + com.google.cloud.eventarc.v1.StateCondition.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.StateCondition.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.TriggerProto + .internal_static_google_cloud_eventarc_v1_StateCondition_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.StateCondition getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.StateCondition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.StateCondition build() { + com.google.cloud.eventarc.v1.StateCondition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.StateCondition buildPartial() { + com.google.cloud.eventarc.v1.StateCondition result = + new com.google.cloud.eventarc.v1.StateCondition(this); + result.code_ = code_; + result.message_ = message_; + 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.cloud.eventarc.v1.StateCondition) { + return mergeFrom((com.google.cloud.eventarc.v1.StateCondition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.StateCondition other) { + if (other == com.google.cloud.eventarc.v1.StateCondition.getDefaultInstance()) return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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 8: + { + code_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + message_ = 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 code_ = 0; + /** + * + * + *
+     * The canonical code of the condition.
+     * 
+ * + * .google.rpc.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * The canonical code of the condition.
+     * 
+ * + * .google.rpc.Code code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The canonical code of the condition.
+     * 
+ * + * .google.rpc.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.rpc.Code getCode() { + @SuppressWarnings("deprecation") + com.google.rpc.Code result = com.google.rpc.Code.valueOf(code_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The canonical code of the condition.
+     * 
+ * + * .google.rpc.Code code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.rpc.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The canonical code of the condition.
+     * 
+ * + * .google.rpc.Code code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * Human-readable message.
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable message.
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable message.
+     * 
+ * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable message.
+     * 
+ * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable message.
+     * 
+ * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = 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.cloud.eventarc.v1.StateCondition) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.StateCondition) + private static final com.google.cloud.eventarc.v1.StateCondition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.StateCondition(); + } + + public static com.google.cloud.eventarc.v1.StateCondition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateCondition 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.cloud.eventarc.v1.StateCondition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/StateConditionOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/StateConditionOrBuilder.java new file mode 100644 index 000000000000..f99922fa22f0 --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/StateConditionOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/cloud/eventarc/v1/trigger.proto + +package com.google.cloud.eventarc.v1; + +public interface StateConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.StateCondition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The canonical code of the condition.
+   * 
+ * + * .google.rpc.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+   * The canonical code of the condition.
+   * 
+ * + * .google.rpc.Code code = 1; + * + * @return The code. + */ + com.google.rpc.Code getCode(); + + /** + * + * + *
+   * Human-readable message.
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * Human-readable message.
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Trigger.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Trigger.java index aab650c0a51b..4c016a63dd45 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Trigger.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Trigger.java @@ -68,6 +68,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 12: return internalGetLabels(); + case 15: + return internalGetConditions(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -291,7 +293,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -307,7 +309,7 @@ public java.util.List getEventFiltersL * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -324,7 +326,7 @@ public java.util.List getEventFiltersL * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -340,7 +342,7 @@ public int getEventFiltersCount() { * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -356,7 +358,7 @@ public com.google.cloud.eventarc.v1.EventFilter getEventFilters(int index) { * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -712,6 +714,124 @@ public com.google.protobuf.ByteString getChannelBytes() { } } + public static final int CONDITIONS_FIELD_NUMBER = 15; + + private static final class ConditionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.eventarc.v1.StateCondition> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.eventarc.v1.TriggerProto + .internal_static_google_cloud_eventarc_v1_Trigger_ConditionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.eventarc.v1.StateCondition.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.eventarc.v1.StateCondition> + conditions_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.eventarc.v1.StateCondition> + internalGetConditions() { + if (conditions_ == null) { + return com.google.protobuf.MapField.emptyMapField(ConditionsDefaultEntryHolder.defaultEntry); + } + return conditions_; + } + + public int getConditionsCount() { + return internalGetConditions().getMap().size(); + } + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public boolean containsConditions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConditions().getMap().containsKey(key); + } + /** Use {@link #getConditionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getConditions() { + return getConditionsMap(); + } + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.Map + getConditionsMap() { + return internalGetConditions().getMap(); + } + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.StateCondition getConditionsOrDefault( + java.lang.String key, com.google.cloud.eventarc.v1.StateCondition defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConditions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.StateCondition getConditionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConditions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public static final int ETAG_FIELD_NUMBER = 99; private volatile java.lang.Object etag_; /** @@ -808,6 +928,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 13, channel_); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetConditions(), ConditionsDefaultEntryHolder.defaultEntry, 15); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 99, etag_); } @@ -857,6 +979,17 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, channel_); } + for (java.util.Map.Entry entry : + internalGetConditions().getMap().entrySet()) { + com.google.protobuf.MapEntry + conditions__ = + ConditionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, conditions__); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(99, etag_); } @@ -897,6 +1030,7 @@ public boolean equals(final java.lang.Object obj) { } if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (!getChannel().equals(other.getChannel())) return false; + if (!internalGetConditions().equals(other.internalGetConditions())) return false; if (!getEtag().equals(other.getEtag())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -941,6 +1075,10 @@ public int hashCode() { } hash = (37 * hash) + CHANNEL_FIELD_NUMBER; hash = (53 * hash) + getChannel().hashCode(); + if (!internalGetConditions().getMap().isEmpty()) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetConditions().hashCode(); + } hash = (37 * hash) + ETAG_FIELD_NUMBER; hash = (53 * hash) + getEtag().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); @@ -1065,6 +1203,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 12: return internalGetLabels(); + case 15: + return internalGetConditions(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -1075,6 +1215,8 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { switch (number) { case 12: return internalGetMutableLabels(); + case 15: + return internalGetMutableConditions(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -1140,6 +1282,7 @@ public Builder clear() { internalGetMutableLabels().clear(); channel_ = ""; + internalGetMutableConditions().clear(); etag_ = ""; return this; @@ -1204,6 +1347,8 @@ public com.google.cloud.eventarc.v1.Trigger buildPartial() { result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); result.channel_ = channel_; + result.conditions_ = internalGetConditions(); + result.conditions_.makeImmutable(); result.etag_ = etag_; onBuilt(); return result; @@ -1310,6 +1455,7 @@ public Builder mergeFrom(com.google.cloud.eventarc.v1.Trigger other) { channel_ = other.channel_; onChanged(); } + internalGetMutableConditions().mergeFrom(other.internalGetConditions()); if (!other.getEtag().isEmpty()) { etag_ = other.etag_; onChanged(); @@ -1412,6 +1558,19 @@ public Builder mergeFrom( break; } // case 106 + case 122: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.eventarc.v1.StateCondition> + conditions__ = + input.readMessage( + ConditionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableConditions() + .getMutableMap() + .put(conditions__.getKey(), conditions__.getValue()); + break; + } // case 122 case 794: { etag_ = input.readStringRequireUtf8(); @@ -2087,7 +2246,7 @@ private void ensureEventFiltersIsMutable() { * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2106,7 +2265,7 @@ public java.util.List getEventFiltersL * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2125,7 +2284,7 @@ public int getEventFiltersCount() { * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2144,7 +2303,7 @@ public com.google.cloud.eventarc.v1.EventFilter getEventFilters(int index) { * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2169,7 +2328,7 @@ public Builder setEventFilters(int index, com.google.cloud.eventarc.v1.EventFilt * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2192,7 +2351,7 @@ public Builder setEventFilters( * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2217,7 +2376,7 @@ public Builder addEventFilters(com.google.cloud.eventarc.v1.EventFilter value) { * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2242,7 +2401,7 @@ public Builder addEventFilters(int index, com.google.cloud.eventarc.v1.EventFilt * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2265,7 +2424,7 @@ public Builder addEventFilters( * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2288,7 +2447,7 @@ public Builder addEventFilters( * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2311,7 +2470,7 @@ public Builder addAllEventFilters( * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2333,7 +2492,7 @@ public Builder clearEventFilters() { * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2355,7 +2514,7 @@ public Builder removeEventFilters(int index) { * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2370,7 +2529,7 @@ public com.google.cloud.eventarc.v1.EventFilter.Builder getEventFiltersBuilder(i * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2389,7 +2548,7 @@ public com.google.cloud.eventarc.v1.EventFilterOrBuilder getEventFiltersOrBuilde * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2409,7 +2568,7 @@ public com.google.cloud.eventarc.v1.EventFilterOrBuilder getEventFiltersOrBuilde * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2425,7 +2584,7 @@ public com.google.cloud.eventarc.v1.EventFilter.Builder addEventFiltersBuilder() * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -2441,7 +2600,7 @@ public com.google.cloud.eventarc.v1.EventFilter.Builder addEventFiltersBuilder(i * * *
-     * Required. null The list of filters that applies to event attributes. Only events that
+     * Required. Unordered list. The list of filters that applies to event attributes. Only events that
      * match all the provided filters are sent to the destination.
      * 
* @@ -3350,6 +3509,192 @@ public Builder setChannelBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.eventarc.v1.StateCondition> + conditions_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.eventarc.v1.StateCondition> + internalGetConditions() { + if (conditions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ConditionsDefaultEntryHolder.defaultEntry); + } + return conditions_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.eventarc.v1.StateCondition> + internalGetMutableConditions() { + onChanged(); + ; + if (conditions_ == null) { + conditions_ = + com.google.protobuf.MapField.newMapField(ConditionsDefaultEntryHolder.defaultEntry); + } + if (!conditions_.isMutable()) { + conditions_ = conditions_.copy(); + } + return conditions_; + } + + public int getConditionsCount() { + return internalGetConditions().getMap().size(); + } + /** + * + * + *
+     * Output only. The reason(s) why a trigger is in FAILED state.
+     * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public boolean containsConditions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConditions().getMap().containsKey(key); + } + /** Use {@link #getConditionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getConditions() { + return getConditionsMap(); + } + /** + * + * + *
+     * Output only. The reason(s) why a trigger is in FAILED state.
+     * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.Map + getConditionsMap() { + return internalGetConditions().getMap(); + } + /** + * + * + *
+     * Output only. The reason(s) why a trigger is in FAILED state.
+     * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.StateCondition getConditionsOrDefault( + java.lang.String key, com.google.cloud.eventarc.v1.StateCondition defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConditions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Output only. The reason(s) why a trigger is in FAILED state.
+     * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.StateCondition getConditionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConditions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearConditions() { + internalGetMutableConditions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Output only. The reason(s) why a trigger is in FAILED state.
+     * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeConditions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableConditions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableConditions() { + return internalGetMutableConditions().getMutableMap(); + } + /** + * + * + *
+     * Output only. The reason(s) why a trigger is in FAILED state.
+     * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder putConditions( + java.lang.String key, com.google.cloud.eventarc.v1.StateCondition value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableConditions().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Output only. The reason(s) why a trigger is in FAILED state.
+     * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder putAllConditions( + java.util.Map values) { + internalGetMutableConditions().getMutableMap().putAll(values); + return this; + } + private java.lang.Object etag_ = ""; /** * diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerOrBuilder.java index a4dc40c3ed95..b70bcf81e424 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerOrBuilder.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerOrBuilder.java @@ -159,7 +159,7 @@ public interface TriggerOrBuilder * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -172,7 +172,7 @@ public interface TriggerOrBuilder * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -185,7 +185,7 @@ public interface TriggerOrBuilder * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -198,7 +198,7 @@ public interface TriggerOrBuilder * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -212,7 +212,7 @@ public interface TriggerOrBuilder * * *
-   * Required. null The list of filters that applies to event attributes. Only events that
+   * Required. Unordered list. The list of filters that applies to event attributes. Only events that
    * match all the provided filters are sent to the destination.
    * 
* @@ -452,6 +452,75 @@ java.lang.String getLabelsOrDefault( */ com.google.protobuf.ByteString getChannelBytes(); + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getConditionsCount(); + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + boolean containsConditions(java.lang.String key); + /** Use {@link #getConditionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getConditions(); + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.Map getConditionsMap(); + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + + /* nullable */ + com.google.cloud.eventarc.v1.StateCondition getConditionsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.eventarc.v1.StateCondition defaultValue); + /** + * + * + *
+   * Output only. The reason(s) why a trigger is in FAILED state.
+   * 
+ * + * + * map<string, .google.cloud.eventarc.v1.StateCondition> conditions = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.eventarc.v1.StateCondition getConditionsOrThrow(java.lang.String key); + /** * * diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerProto.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerProto.java index 1485f969c925..5e0e15dff700 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerProto.java +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/TriggerProto.java @@ -35,10 +35,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_eventarc_v1_Trigger_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_eventarc_v1_Trigger_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_Trigger_ConditionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_Trigger_ConditionsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_eventarc_v1_EventFilter_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_eventarc_v1_EventFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_StateCondition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_StateCondition_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_eventarc_v1_Destination_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -71,50 +79,61 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n&google/cloud/eventarc/v1/trigger.proto" + "\022\030google.cloud.eventarc.v1\032\037google/api/f" + "ield_behavior.proto\032\031google/api/resource" - + ".proto\032\037google/protobuf/timestamp.proto\"" - + "\263\005\n\007Trigger\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\020\n\003uid\030\002 " - + "\001(\tB\003\340A\003\0224\n\013create_time\030\005 \001(\0132\032.google.p" - + "rotobuf.TimestampB\003\340A\003\0224\n\013update_time\030\006 " - + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022D\n\r" - + "event_filters\030\010 \003(\0132%.google.cloud.event" - + "arc.v1.EventFilterB\006\340A\006\340A\002\022B\n\017service_ac" - + "count\030\t \001(\tB)\340A\001\372A#\n!iam.googleapis.com/" - + "ServiceAccount\022?\n\013destination\030\n \001(\0132%.go" - + "ogle.cloud.eventarc.v1.DestinationB\003\340A\002\022" - + ";\n\ttransport\030\013 \001(\0132#.google.cloud.eventa" - + "rc.v1.TransportB\003\340A\001\022B\n\006labels\030\014 \003(\0132-.g" - + "oogle.cloud.eventarc.v1.Trigger.LabelsEn" - + "tryB\003\340A\001\022\024\n\007channel\030\r \001(\tB\003\340A\001\022\021\n\004etag\030c" - + " \001(\tB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\t:\0028\001:s\352Ap\n\037eventarc.googleap" - + "is.com/Trigger\022:projects/{project}/locat" - + "ions/{location}/triggers/{trigger}*\010trig" - + "gers2\007trigger\"P\n\013EventFilter\022\026\n\tattribut" - + "e\030\001 \001(\tB\003\340A\002\022\022\n\005value\030\002 \001(\tB\003\340A\002\022\025\n\010oper" - + "ator\030\003 \001(\tB\003\340A\001\"\316\001\n\013Destination\0227\n\tcloud" - + "_run\030\001 \001(\0132\".google.cloud.eventarc.v1.Cl" - + "oudRunH\000\022J\n\016cloud_function\030\002 \001(\tB0\372A-\n+c" - + "loudfunctions.googleapis.com/CloudFuncti" - + "onH\000\022,\n\003gke\030\003 \001(\0132\035.google.cloud.eventar" - + "c.v1.GKEH\000B\014\n\ndescriptor\"O\n\tTransport\0222\n" - + "\006pubsub\030\001 \001(\0132 .google.cloud.eventarc.v1" - + ".PubsubH\000B\016\n\014intermediary\"g\n\010CloudRun\0223\n" - + "\007service\030\001 \001(\tB\"\340A\002\372A\034\n\032run.googleapis.c" - + "om/Service\022\021\n\004path\030\002 \001(\tB\003\340A\001\022\023\n\006region\030" - + "\003 \001(\tB\003\340A\002\"s\n\003GKE\022\024\n\007cluster\030\001 \001(\tB\003\340A\002\022" - + "\025\n\010location\030\002 \001(\tB\003\340A\002\022\026\n\tnamespace\030\003 \001(" - + "\tB\003\340A\002\022\024\n\007service\030\004 \001(\tB\003\340A\002\022\021\n\004path\030\005 \001" - + "(\tB\003\340A\001\"7\n\006Pubsub\022\022\n\005topic\030\001 \001(\tB\003\340A\001\022\031\n" - + "\014subscription\030\002 \001(\tB\003\340A\003B\334\002\n\034com.google." - + "cloud.eventarc.v1B\014TriggerProtoP\001Z@googl" - + "e.golang.org/genproto/googleapis/cloud/e" - + "ventarc/v1;eventarc\352Ak\n+cloudfunctions.g" - + "oogleapis.com/CloudFunction\022 + * The request message for the UpdateGoogleChannelConfig method. + *
+ * + * Protobuf type {@code google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest} + */ +public final class UpdateGoogleChannelConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) + UpdateGoogleChannelConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateGoogleChannelConfigRequest.newBuilder() to construct. + private UpdateGoogleChannelConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateGoogleChannelConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateGoogleChannelConfigRequest(); + } + + @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.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.class, + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.Builder.class); + } + + public static final int GOOGLE_CHANNEL_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.eventarc.v1.GoogleChannelConfig googleChannelConfig_; + /** + * + * + *
+   * Required. The config to be updated.
+   * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the googleChannelConfig field is set. + */ + @java.lang.Override + public boolean hasGoogleChannelConfig() { + return googleChannelConfig_ != null; + } + /** + * + * + *
+   * Required. The config to be updated.
+   * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The googleChannelConfig. + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.GoogleChannelConfig getGoogleChannelConfig() { + return googleChannelConfig_ == null + ? com.google.cloud.eventarc.v1.GoogleChannelConfig.getDefaultInstance() + : googleChannelConfig_; + } + /** + * + * + *
+   * Required. The config to be updated.
+   * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.GoogleChannelConfigOrBuilder + getGoogleChannelConfigOrBuilder() { + return getGoogleChannelConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The fields to be updated; only fields explicitly provided are updated.
+   * If no field mask is provided, all provided fields in the request are
+   * updated. To update all fields, provide a field mask of "*".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The fields to be updated; only fields explicitly provided are updated.
+   * If no field mask is provided, all provided fields in the request are
+   * updated. To update all fields, provide a field mask of "*".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The fields to be updated; only fields explicitly provided are updated.
+   * If no field mask is provided, all provided fields in the request are
+   * updated. To update all fields, provide a field mask of "*".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (googleChannelConfig_ != null) { + output.writeMessage(1, getGoogleChannelConfig()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (googleChannelConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGoogleChannelConfig()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest other = + (com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) obj; + + if (hasGoogleChannelConfig() != other.hasGoogleChannelConfig()) return false; + if (hasGoogleChannelConfig()) { + if (!getGoogleChannelConfig().equals(other.getGoogleChannelConfig())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGoogleChannelConfig()) { + hash = (37 * hash) + GOOGLE_CHANNEL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGoogleChannelConfig().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest 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.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest 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.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest 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.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest 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.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for the UpdateGoogleChannelConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.class, + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (googleChannelConfigBuilder_ == null) { + googleChannelConfig_ = null; + } else { + googleChannelConfig_ = null; + googleChannelConfigBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_UpdateGoogleChannelConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest build() { + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest buildPartial() { + com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest result = + new com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest(this); + if (googleChannelConfigBuilder_ == null) { + result.googleChannelConfig_ = googleChannelConfig_; + } else { + result.googleChannelConfig_ = googleChannelConfigBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) { + return mergeFrom((com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest other) { + if (other + == com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest.getDefaultInstance()) + return this; + if (other.hasGoogleChannelConfig()) { + mergeGoogleChannelConfig(other.getGoogleChannelConfig()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getGoogleChannelConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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 com.google.cloud.eventarc.v1.GoogleChannelConfig googleChannelConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.eventarc.v1.GoogleChannelConfig, + com.google.cloud.eventarc.v1.GoogleChannelConfig.Builder, + com.google.cloud.eventarc.v1.GoogleChannelConfigOrBuilder> + googleChannelConfigBuilder_; + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the googleChannelConfig field is set. + */ + public boolean hasGoogleChannelConfig() { + return googleChannelConfigBuilder_ != null || googleChannelConfig_ != null; + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The googleChannelConfig. + */ + public com.google.cloud.eventarc.v1.GoogleChannelConfig getGoogleChannelConfig() { + if (googleChannelConfigBuilder_ == null) { + return googleChannelConfig_ == null + ? com.google.cloud.eventarc.v1.GoogleChannelConfig.getDefaultInstance() + : googleChannelConfig_; + } else { + return googleChannelConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGoogleChannelConfig(com.google.cloud.eventarc.v1.GoogleChannelConfig value) { + if (googleChannelConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + googleChannelConfig_ = value; + onChanged(); + } else { + googleChannelConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGoogleChannelConfig( + com.google.cloud.eventarc.v1.GoogleChannelConfig.Builder builderForValue) { + if (googleChannelConfigBuilder_ == null) { + googleChannelConfig_ = builderForValue.build(); + onChanged(); + } else { + googleChannelConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGoogleChannelConfig( + com.google.cloud.eventarc.v1.GoogleChannelConfig value) { + if (googleChannelConfigBuilder_ == null) { + if (googleChannelConfig_ != null) { + googleChannelConfig_ = + com.google.cloud.eventarc.v1.GoogleChannelConfig.newBuilder(googleChannelConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + googleChannelConfig_ = value; + } + onChanged(); + } else { + googleChannelConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGoogleChannelConfig() { + if (googleChannelConfigBuilder_ == null) { + googleChannelConfig_ = null; + onChanged(); + } else { + googleChannelConfig_ = null; + googleChannelConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.eventarc.v1.GoogleChannelConfig.Builder + getGoogleChannelConfigBuilder() { + + onChanged(); + return getGoogleChannelConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.eventarc.v1.GoogleChannelConfigOrBuilder + getGoogleChannelConfigOrBuilder() { + if (googleChannelConfigBuilder_ != null) { + return googleChannelConfigBuilder_.getMessageOrBuilder(); + } else { + return googleChannelConfig_ == null + ? com.google.cloud.eventarc.v1.GoogleChannelConfig.getDefaultInstance() + : googleChannelConfig_; + } + } + /** + * + * + *
+     * Required. The config to be updated.
+     * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.eventarc.v1.GoogleChannelConfig, + com.google.cloud.eventarc.v1.GoogleChannelConfig.Builder, + com.google.cloud.eventarc.v1.GoogleChannelConfigOrBuilder> + getGoogleChannelConfigFieldBuilder() { + if (googleChannelConfigBuilder_ == null) { + googleChannelConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.eventarc.v1.GoogleChannelConfig, + com.google.cloud.eventarc.v1.GoogleChannelConfig.Builder, + com.google.cloud.eventarc.v1.GoogleChannelConfigOrBuilder>( + getGoogleChannelConfig(), getParentForChildren(), isClean()); + googleChannelConfig_ = null; + } + return googleChannelConfigBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The fields to be updated; only fields explicitly provided are updated.
+     * If no field mask is provided, all provided fields in the request are
+     * updated. To update all fields, provide a field mask of "*".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) + private static final com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest(); + } + + public static com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateGoogleChannelConfigRequest 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.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/UpdateGoogleChannelConfigRequestOrBuilder.java b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/UpdateGoogleChannelConfigRequestOrBuilder.java new file mode 100644 index 000000000000..ac41284ecb50 --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/UpdateGoogleChannelConfigRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * 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/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +public interface UpdateGoogleChannelConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The config to be updated.
+   * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the googleChannelConfig field is set. + */ + boolean hasGoogleChannelConfig(); + /** + * + * + *
+   * Required. The config to be updated.
+   * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The googleChannelConfig. + */ + com.google.cloud.eventarc.v1.GoogleChannelConfig getGoogleChannelConfig(); + /** + * + * + *
+   * Required. The config to be updated.
+   * 
+ * + * + * .google.cloud.eventarc.v1.GoogleChannelConfig google_channel_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.eventarc.v1.GoogleChannelConfigOrBuilder getGoogleChannelConfigOrBuilder(); + + /** + * + * + *
+   * The fields to be updated; only fields explicitly provided are updated.
+   * If no field mask is provided, all provided fields in the request are
+   * updated. To update all fields, provide a field mask of "*".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The fields to be updated; only fields explicitly provided are updated.
+   * If no field mask is provided, all provided fields in the request are
+   * updated. To update all fields, provide a field mask of "*".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The fields to be updated; only fields explicitly provided are updated.
+   * If no field mask is provided, all provided fields in the request are
+   * updated. To update all fields, provide a field mask of "*".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel.proto b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel.proto index 11627e450ee7..9c5395580b1d 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel.proto +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel.proto @@ -56,40 +56,45 @@ message Channel { // event provider. ACTIVE = 2; - // The INACTIVE state means that the Channel cannot receive events + // The INACTIVE state indicates that the Channel cannot receive events // permanently. There are two possible cases this state can happen: + // // 1. The SaaS provider disconnected from this Channel. // 2. The Channel activation token has expired but the SaaS provider // wasn't connected. + // // To re-establish a Connection with a provider, the subscriber // should create a new Channel and give it to the provider. INACTIVE = 3; } - // Required. The resource name of the channel. Must be unique within the location - // on the project and must be in + // Required. The resource name of the channel. Must be unique within the + // location on the project and must be in // `projects/{project}/locations/{location}/channels/{channel_id}` format. string name = 1 [(google.api.field_behavior) = REQUIRED]; - // Output only. Server assigned unique identifier for the channel. The value is a UUID4 - // string and guaranteed to remain unchanged until the resource is deleted. + // Output only. Server assigned unique identifier for the channel. The value + // is a UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The creation time. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. The name of the event provider (e.g. Eventarc SaaS partner) associated + // The name of the event provider (e.g. Eventarc SaaS partner) associated // with the channel. This provider will be granted permissions to publish // events to the channel. Format: // `projects/{project}/locations/{location}/providers/{provider_id}`. - string provider = 7 [(google.api.field_behavior) = REQUIRED]; + string provider = 7; oneof transport { - // Output only. The name of the Pub/Sub topic created and managed by Eventarc system as - // a transport for the event delivery. Format: + // Output only. The name of the Pub/Sub topic created and managed by + // Eventarc system as a transport for the event delivery. Format: // `projects/{project}/topics/{topic_id}`. string pubsub_topic = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -97,7 +102,19 @@ message Channel { // Output only. The state of a Channel. State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The activation token for the channel. The token must be used by the - // provider to register the channel for publishing. + // Output only. The activation token for the channel. The token must be used + // by the provider to register the channel for publishing. string activation_token = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt their event data. + // + // It must match the pattern + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string crypto_key_name = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; } diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel_connection.proto b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel_connection.proto index ae1e0f7de1b9..576b5cc59f03 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel_connection.proto +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/channel_connection.proto @@ -59,12 +59,10 @@ message ChannelConnection { ]; // Output only. The creation time. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Input only. Activation token for the channel. The token will be used // during the creation of ChannelConnection to bind the channel with the diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto index 69310678a15c..44d46fce3b86 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/cloud/eventarc/v1/channel.proto"; import "google/cloud/eventarc/v1/channel_connection.proto"; import "google/cloud/eventarc/v1/discovery.proto"; +import "google/cloud/eventarc/v1/google_channel_config.proto"; import "google/cloud/eventarc/v1/trigger.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; @@ -206,6 +207,23 @@ service Eventarc { metadata_type: "OperationMetadata" }; } + + // Get a GoogleChannelConfig + rpc GetGoogleChannelConfig(GetGoogleChannelConfigRequest) returns (GoogleChannelConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/googleChannelConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Update a single GoogleChannelConfig + rpc UpdateGoogleChannelConfig(UpdateGoogleChannelConfigRequest) returns (GoogleChannelConfig) { + option (google.api.http) = { + patch: "/v1/{google_channel_config.name=projects/*/locations/*/googleChannelConfig}" + body: "google_channel_config" + }; + option (google.api.method_signature) = "google_channel_config,update_mask"; + } } // The request message for the GetTrigger method. @@ -230,6 +248,7 @@ message ListTriggersRequest { ]; // The maximum number of triggers to return on each page. + // // Note: The service may send fewer. int32 page_size = 2; @@ -245,6 +264,11 @@ message ListTriggersRequest { // specify descending order for a field, append a `desc` suffix; for example: // `name desc, trigger_id`. string order_by = 4; + + // Filter field. Used to filter the Triggers to be listed. Possible filters + // are described in https://google.aip.dev/160. For example, using + // "?filter=destination:gke" would list only Triggers with a gke destination. + string filter = 5; } // The response message for the `ListTriggers` method. @@ -252,7 +276,7 @@ message ListTriggersResponse { // The requested triggers, up to the number specified in `page_size`. repeated Trigger triggers = 1; - // A page token that can be sent to ListTriggers to request the next page. + // A page token that can be sent to `ListTriggers` to request the next page. // If this is empty, then there are no more pages. string next_page_token = 2; @@ -345,6 +369,7 @@ message ListChannelsRequest { ]; // The maximum number of channels to return on each page. + // // Note: The service may send fewer. int32 page_size = 2; @@ -367,7 +392,7 @@ message ListChannelsResponse { // The requested channels, up to the number specified in `page_size`. repeated Channel channels = 1; - // A page token that can be sent to ListChannels to request the next page. + // A page token that can be sent to `ListChannels` to request the next page. // If this is empty, then there are no more pages. string next_page_token = 2; @@ -472,7 +497,7 @@ message ListProvidersResponse { // The requested providers, up to the number specified in `page_size`. repeated Provider providers = 1; - // A page token that can be sent to ListProviders to request the next page. + // A page token that can be sent to `ListProviders` to request the next page. // If this is empty, then there are no more pages. string next_page_token = 2; @@ -502,6 +527,7 @@ message ListChannelConnectionsRequest { ]; // The maximum number of channel connections to return on each page. + // // Note: The service may send fewer responses. int32 page_size = 2; @@ -519,7 +545,7 @@ message ListChannelConnectionsResponse { // `page_size`. repeated ChannelConnection channel_connections = 1; - // A page token that can be sent to ListChannelConnections to request the + // A page token that can be sent to `ListChannelConnections` to request the // next page. // If this is empty, then there are no more pages. string next_page_token = 2; @@ -556,6 +582,28 @@ message DeleteChannelConnectionRequest { ]; } +// The request message for the UpdateGoogleChannelConfig method. +message UpdateGoogleChannelConfigRequest { + // Required. The config to be updated. + GoogleChannelConfig google_channel_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The fields to be updated; only fields explicitly provided are updated. + // If no field mask is provided, all provided fields in the request are + // updated. To update all fields, provide a field mask of "*". + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the GetGoogleChannelConfig method. +message GetGoogleChannelConfigRequest { + // Required. The name of the config to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/GoogleChannelConfig" + } + ]; +} + // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/google_channel_config.proto b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/google_channel_config.proto new file mode 100644 index 000000000000..2b440b57dc4a --- /dev/null +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/google_channel_config.proto @@ -0,0 +1,65 @@ +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.eventarc.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Eventarc.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc"; +option java_multiple_files = true; +option java_outer_classname = "GoogleChannelConfigProto"; +option java_package = "com.google.cloud.eventarc.v1"; +option php_namespace = "Google\\Cloud\\Eventarc\\V1"; +option ruby_package = "Google::Cloud::Eventarc::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// A GoogleChannelConfig is a resource that stores the custom settings +// respected by Eventarc first-party triggers in the matching region. +// Once configured, first-party event data will be protected +// using the specified custom managed encryption key instead of Google-managed +// encryption keys. +message GoogleChannelConfig { + option (google.api.resource) = { + type: "eventarc.googleapis.com/GoogleChannelConfig" + pattern: "projects/{project}/locations/{location}/googleChannelConfig" + singular: "googleChannelConfig" + }; + + // Required. The resource name of the config. Must be in the format of, + // `projects/{project}/locations/{location}/googleChannelConfig`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt their event data. + // + // It must match the pattern + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string crypto_key_name = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} diff --git a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/trigger.proto b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/trigger.proto index 45f8a8463f8d..c4ede775f0af 100644 --- a/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/trigger.proto +++ b/java-eventarc/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/trigger.proto @@ -19,6 +19,7 @@ package google.cloud.eventarc.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/code.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc"; option java_multiple_files = true; @@ -36,6 +37,11 @@ option (google.api.resource_definition) = { type: "run.googleapis.com/Service" pattern: "*" }; +option (google.api.resource_definition) = { + type: "workflows.googleapis.com/Workflow" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}" +}; + // A representation of the trigger resource. message Trigger { @@ -61,7 +67,7 @@ message Trigger { // Output only. The last-modified time. google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. null The list of filters that applies to event attributes. Only events that + // Required. Unordered list. The list of filters that applies to event attributes. Only events that // match all the provided filters are sent to the destination. repeated EventFilter event_filters = 8 [ (google.api.field_behavior) = UNORDERED_LIST, @@ -106,6 +112,9 @@ message Trigger { // You must provide a channel to receive events from Eventarc SaaS partners. string channel = 13 [(google.api.field_behavior) = OPTIONAL]; + // Output only. The reason(s) why a trigger is in FAILED state. + map conditions = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. This checksum is computed by the server based on the value of other // fields, and might be sent only on create requests to ensure that the // client has an up-to-date value before proceeding. @@ -130,6 +139,15 @@ message EventFilter { string operator = 3 [(google.api.field_behavior) = OPTIONAL]; } +// A condition that is part of the trigger state computation. +message StateCondition { + // The canonical code of the condition. + google.rpc.Code code = 1; + + // Human-readable message. + string message = 2; +} + // Represents a target of an invocation over HTTP. message Destination { oneof descriptor { @@ -146,6 +164,14 @@ message Destination { // A GKE service capable of receiving events. The service should be running // in the same project as the trigger. GKE gke = 3; + + // The resource name of the Workflow whose Executions are triggered by + // the events. The Workflow resource should be deployed in the same project + // as the trigger. + // Format: `projects/{project}/locations/{location}/workflows/{workflow}` + string workflow = 4 [(google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + }]; } } diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/AsyncGetGoogleChannelConfig.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/AsyncGetGoogleChannelConfig.java new file mode 100644 index 000000000000..cd1da8a90459 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/AsyncGetGoogleChannelConfig.java @@ -0,0 +1,50 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; +import com.google.cloud.eventarc.v1.GoogleChannelConfigName; + +public class AsyncGetGoogleChannelConfig { + + public static void main(String[] args) throws Exception { + asyncGetGoogleChannelConfig(); + } + + public static void asyncGetGoogleChannelConfig() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GetGoogleChannelConfigRequest request = + GetGoogleChannelConfigRequest.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + eventarcClient.getGoogleChannelConfigCallable().futureCall(request); + // Do something. + GoogleChannelConfig response = future.get(); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfig.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfig.java new file mode 100644 index 000000000000..6f7efe5d7209 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfig.java @@ -0,0 +1,46 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; +import com.google.cloud.eventarc.v1.GoogleChannelConfigName; + +public class SyncGetGoogleChannelConfig { + + public static void main(String[] args) throws Exception { + syncGetGoogleChannelConfig(); + } + + public static void syncGetGoogleChannelConfig() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GetGoogleChannelConfigRequest request = + GetGoogleChannelConfigRequest.newBuilder() + .setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(request); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfigGooglechannelconfigname.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfigGooglechannelconfigname.java new file mode 100644 index 000000000000..cb60c7c9c0a3 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfigGooglechannelconfigname.java @@ -0,0 +1,42 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_Googlechannelconfigname_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; +import com.google.cloud.eventarc.v1.GoogleChannelConfigName; + +public class SyncGetGoogleChannelConfigGooglechannelconfigname { + + public static void main(String[] args) throws Exception { + syncGetGoogleChannelConfigGooglechannelconfigname(); + } + + public static void syncGetGoogleChannelConfigGooglechannelconfigname() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]"); + GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_Googlechannelconfigname_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfigString.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfigString.java new file mode 100644 index 000000000000..83a8c30a5a5d --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getgooglechannelconfig/SyncGetGoogleChannelConfigString.java @@ -0,0 +1,42 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_String_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; +import com.google.cloud.eventarc.v1.GoogleChannelConfigName; + +public class SyncGetGoogleChannelConfigString { + + public static void main(String[] args) throws Exception { + syncGetGoogleChannelConfigString(); + } + + public static void syncGetGoogleChannelConfigString() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + String name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString(); + GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_String_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getiampolicy/AsyncGetIamPolicy.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..557400c78620 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = eventarcClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetIamPolicy_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getiampolicy/SyncGetIamPolicy.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..90454e341865 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetIamPolicy_sync] +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = eventarcClient.getIamPolicy(request); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetIamPolicy_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getlocation/AsyncGetLocation.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..4e445f06a089 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = eventarcClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetLocation_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getlocation/SyncGetLocation.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..01d5e17b95de --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_GetLocation_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = eventarcClient.getLocation(request); + } + } +} +// [END eventarc_v1_generated_Eventarc_GetLocation_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/AsyncListLocations.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..398e6a12123c --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/AsyncListLocations.java @@ -0,0 +1,53 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = eventarcClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_Eventarc_ListLocations_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/AsyncListLocationsPaged.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..43feb3e4f1f9 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_ListLocations_Paged_async] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = eventarcClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END eventarc_v1_generated_Eventarc_ListLocations_Paged_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/SyncListLocations.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..2e74d1dfd282 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_ListLocations_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : eventarcClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_Eventarc_ListLocations_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggers.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggers.java index ae097a8745d8..45b00607b0bd 100644 --- a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggers.java +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggers.java @@ -42,6 +42,7 @@ public static void asyncListTriggers() throws Exception { .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") .build(); ApiFuture future = eventarcClient.listTriggersPagedCallable().futureCall(request); // Do something. diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggersPaged.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggersPaged.java index e36eb440a04e..5f7f0e2ad37f 100644 --- a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggersPaged.java +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/AsyncListTriggersPaged.java @@ -43,6 +43,7 @@ public static void asyncListTriggersPaged() throws Exception { .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") .build(); while (true) { ListTriggersResponse response = eventarcClient.listTriggersCallable().call(request); diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/SyncListTriggers.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/SyncListTriggers.java index aa57434d52b8..241fa3e58e0c 100644 --- a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/SyncListTriggers.java +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/listtriggers/SyncListTriggers.java @@ -41,6 +41,7 @@ public static void syncListTriggers() throws Exception { .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") .build(); for (Trigger element : eventarcClient.listTriggers(request).iterateAll()) { // doThingsWith(element); diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/setiampolicy/AsyncSetIamPolicy.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..c8eee964c687 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = eventarcClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END eventarc_v1_generated_Eventarc_SetIamPolicy_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/setiampolicy/SyncSetIamPolicy.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..2134e52af120 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_SetIamPolicy_sync] +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = eventarcClient.setIamPolicy(request); + } + } +} +// [END eventarc_v1_generated_Eventarc_SetIamPolicy_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/testiampermissions/AsyncTestIamPermissions.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..ceab79476e4f --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + eventarcClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END eventarc_v1_generated_Eventarc_TestIamPermissions_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/testiampermissions/SyncTestIamPermissions.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..8b8ee74a8054 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_TestIamPermissions_sync] +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = eventarcClient.testIamPermissions(request); + } + } +} +// [END eventarc_v1_generated_Eventarc_TestIamPermissions_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/AsyncUpdateGoogleChannelConfig.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/AsyncUpdateGoogleChannelConfig.java new file mode 100644 index 000000000000..a58788074b37 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/AsyncUpdateGoogleChannelConfig.java @@ -0,0 +1,51 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; +import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateGoogleChannelConfig { + + public static void main(String[] args) throws Exception { + asyncUpdateGoogleChannelConfig(); + } + + public static void asyncUpdateGoogleChannelConfig() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateGoogleChannelConfigRequest request = + UpdateGoogleChannelConfigRequest.newBuilder() + .setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + eventarcClient.updateGoogleChannelConfigCallable().futureCall(request); + // Do something. + GoogleChannelConfig response = future.get(); + } + } +} +// [END eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_async] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/SyncUpdateGoogleChannelConfig.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/SyncUpdateGoogleChannelConfig.java new file mode 100644 index 000000000000..dc48d590ef12 --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/SyncUpdateGoogleChannelConfig.java @@ -0,0 +1,47 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; +import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateGoogleChannelConfig { + + public static void main(String[] args) throws Exception { + syncUpdateGoogleChannelConfig(); + } + + public static void syncUpdateGoogleChannelConfig() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateGoogleChannelConfigRequest request = + UpdateGoogleChannelConfigRequest.newBuilder() + .setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + GoogleChannelConfig response = eventarcClient.updateGoogleChannelConfig(request); + } + } +} +// [END eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_sync] diff --git a/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/SyncUpdateGoogleChannelConfigGooglechannelconfigFieldmask.java b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/SyncUpdateGoogleChannelConfigGooglechannelconfigFieldmask.java new file mode 100644 index 000000000000..3165231786df --- /dev/null +++ b/java-eventarc/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarc/updategooglechannelconfig/SyncUpdateGoogleChannelConfigGooglechannelconfigFieldmask.java @@ -0,0 +1,44 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_GooglechannelconfigFieldmask_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GoogleChannelConfig; +import com.google.protobuf.FieldMask; + +public class SyncUpdateGoogleChannelConfigGooglechannelconfigFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateGoogleChannelConfigGooglechannelconfigFieldmask(); + } + + public static void syncUpdateGoogleChannelConfigGooglechannelconfigFieldmask() throws Exception { + // 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 (EventarcClient eventarcClient = EventarcClient.create()) { + GoogleChannelConfig googleChannelConfig = GoogleChannelConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + GoogleChannelConfig response = + eventarcClient.updateGoogleChannelConfig(googleChannelConfig, updateMask); + } + } +} +// [END eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_GooglechannelconfigFieldmask_sync] diff --git a/versions.txt b/versions.txt index c18241428667..0cf7493335d3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,6 @@ # Format: # module:released-version:current-version + gapic-libraries-bom:0.3.0:0.3.0 google-cloud-jar-parent:0.3.0:0.3.0 google-cloud-pom-parent:0.3.0:0.3.0