diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 4a9c6f80d3de..f3a78f15ac38 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -1162,6 +1162,13 @@ pom import + + com.google.cloud + google-cloud-workspaceevents-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-workstations-bom diff --git a/java-workspaceevents/.OwlBot.yaml b/java-workspaceevents/.OwlBot.yaml new file mode 100644 index 000000000000..f2cc87916975 --- /dev/null +++ b/java-workspaceevents/.OwlBot.yaml @@ -0,0 +1,36 @@ +# 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. + + +deep-remove-regex: +- "/java-workspaceevents/grpc-google-.*/src" +- "/java-workspaceevents/proto-google-.*/src" +- "/java-workspaceevents/google-.*/src" +- "/java-workspaceevents/samples/snippets/generated" + +deep-preserve-regex: +- "/java-workspaceevents/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/apps/events/subscriptions/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-workspaceevents/$1/proto-google-cloud-workspaceevents-$1/src" +- source: "/google/apps/events/subscriptions/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-workspaceevents/$1/grpc-google-cloud-workspaceevents-$1/src" +- source: "/google/apps/events/subscriptions/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-workspaceevents/$1/google-cloud-workspaceevents/src" +- source: "/google/apps/events/subscriptions/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-workspaceevents/$1/samples/snippets/generated" + + +api-name: workspaceevents \ No newline at end of file diff --git a/java-workspaceevents/.repo-metadata.json b/java-workspaceevents/.repo-metadata.json new file mode 100644 index 000000000000..084eb41cf321 --- /dev/null +++ b/java-workspaceevents/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_shortname": "workspaceevents", + "name_pretty": "Google Workspace Events API", + "product_documentation": "https://developers.google.com/workspace/events", + "api_description": "The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-workspaceevents/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/java-workspaceevents", + "repo_short": "java-workspaceevents", + "distribution_name": "com.google.cloud:google-cloud-workspaceevents", + "api_id": "workspaceevents.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true, + "rest_documentation": "https://developers.google.com/workspace/events/reference/rest/" +} \ No newline at end of file diff --git a/java-workspaceevents/README.md b/java-workspaceevents/README.md new file mode 100644 index 000000000000..bc0f82d6b468 --- /dev/null +++ b/java-workspaceevents/README.md @@ -0,0 +1,225 @@ +# Google Google Workspace Events API Client for Java + +Java idiomatic client for [Google Workspace Events API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.33.0 + pom + import + + + + + + + com.google.cloud + google-cloud-workspaceevents + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-workspaceevents + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-workspaceevents:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-workspaceevents" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Google Workspace Events API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Google Workspace Events API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Google Workspace Events API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Google Workspace Events API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-workspaceevents` library. See the [Quickstart](#quickstart) section +to add `google-cloud-workspaceevents` as a dependency in your code. + +## About Google Workspace Events API + + +[Google Workspace Events API][product-docs] The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications. + +See the [Google Workspace Events API client library docs][javadocs] to learn how to +use this Google Workspace Events API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Google Workspace Events API uses both gRPC and HTTP/JSON for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://developers.google.com/workspace/events +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-workspaceevents/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workspaceevents/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-workspaceevents.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-workspaceevents/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-workspaceevents/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-workspaceevents/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-workspaceevents/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=workspaceevents.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-workspaceevents/google-cloud-workspaceevents-bom/pom.xml b/java-workspaceevents/google-cloud-workspaceevents-bom/pom.xml new file mode 100644 index 000000000000..a58f3019bd83 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workspaceevents-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.31.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Google Workspace Events API BOM + + BOM for Google Workspace Events API + + + + true + + + + + + com.google.cloud + google-cloud-workspaceevents + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workspaceevents-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workspaceevents-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-workspaceevents/google-cloud-workspaceevents/pom.xml b/java-workspaceevents/google-cloud-workspaceevents/pom.xml new file mode 100644 index 000000000000..33033ac9addd --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workspaceevents + 0.0.1-SNAPSHOT + jar + Google Google Workspace Events API + Google Workspace Events API The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications. + + com.google.cloud + google-cloud-workspaceevents-parent + 0.0.1-SNAPSHOT + + + google-cloud-workspaceevents + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-workspaceevents-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-workspaceevents-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClient.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClient.java new file mode 100644 index 000000000000..e2ed42e78ae8 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClient.java @@ -0,0 +1,1361 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.apps.events.subscriptions.v1.stub.SubscriptionsServiceStub; +import com.google.apps.events.subscriptions.v1.stub.SubscriptionsServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service that manages subscriptions to Google Workspace events. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ *     SubscriptionsServiceClient.create()) {
+ *   SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+ *   Subscription response = subscriptionsServiceClient.getSubscription(name);
+ * }
+ * }
+ * + *

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

CreateSubscription

Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google Workspace subscription](https://developers.google.com/workspace/events/guides/create-subscription).

+ *

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

+ *
    + *
  • createSubscriptionAsync(CreateSubscriptionRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createSubscriptionAsync(Subscription subscription) + *

+ *

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

+ *
    + *
  • createSubscriptionOperationCallable() + *

  • createSubscriptionCallable() + *

+ *

DeleteSubscription

Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google Workspace subscription](https://developers.google.com/workspace/events/guides/delete-subscription).

+ *

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

+ *
    + *
  • deleteSubscriptionAsync(DeleteSubscriptionRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deleteSubscriptionAsync(SubscriptionName name) + *

  • deleteSubscriptionAsync(String name) + *

+ *

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

+ *
    + *
  • deleteSubscriptionOperationCallable() + *

  • deleteSubscriptionCallable() + *

+ *

GetSubscription

Gets details about a Google Workspace subscription. To learn how to use this method, see [Get details about a Google Workspace subscription](https://developers.google.com/workspace/events/guides/get-subscription).

+ *

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

+ *
    + *
  • getSubscription(GetSubscriptionRequest request) + *

+ *

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

+ *
    + *
  • getSubscription(SubscriptionName name) + *

  • getSubscription(String name) + *

+ *

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

+ *
    + *
  • getSubscriptionCallable() + *

+ *

ListSubscriptions

Lists Google Workspace subscriptions. To learn how to use this method, see [List Google Workspace subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).

+ *

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

+ *
    + *
  • listSubscriptions(ListSubscriptionsRequest request) + *

+ *

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

+ *
    + *
  • listSubscriptions(int pageSize, String pageToken, String filter) + *

+ *

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

+ *
    + *
  • listSubscriptionsPagedCallable() + *

  • listSubscriptionsCallable() + *

+ *

UpdateSubscription

Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update or renew a Google Workspace subscription](https://developers.google.com/workspace/events/guides/update-subscription).

+ *

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

+ *
    + *
  • updateSubscriptionAsync(UpdateSubscriptionRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateSubscriptionAsync(Subscription subscription, FieldMask updateMask) + *

+ *

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

+ *
    + *
  • updateSubscriptionOperationCallable() + *

  • updateSubscriptionCallable() + *

+ *

ReactivateSubscription

Reactivates a suspended Google Workspace subscription. + *

This method resets your subscription's `State` field to `ACTIVE`. Before you use this method, you must fix the error that suspended the subscription. To learn how to use this method, see [Reactivate a Google Workspace subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).

+ *

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

+ *
    + *
  • reactivateSubscriptionAsync(ReactivateSubscriptionRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • reactivateSubscriptionAsync(SubscriptionName name) + *

  • reactivateSubscriptionAsync(String name) + *

+ *

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

+ *
    + *
  • reactivateSubscriptionOperationCallable() + *

  • reactivateSubscriptionCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SubscriptionsServiceSettings + * to create(). For example: + * + *

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class SubscriptionsServiceClient implements BackgroundResource { + private final SubscriptionsServiceSettings settings; + private final SubscriptionsServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of SubscriptionsServiceClient with default settings. */ + public static final SubscriptionsServiceClient create() throws IOException { + return create(SubscriptionsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SubscriptionsServiceClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SubscriptionsServiceClient create(SubscriptionsServiceSettings settings) + throws IOException { + return new SubscriptionsServiceClient(settings); + } + + /** + * Constructs an instance of SubscriptionsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SubscriptionsServiceSettings). + */ + public static final SubscriptionsServiceClient create(SubscriptionsServiceStub stub) { + return new SubscriptionsServiceClient(stub); + } + + /** + * Constructs an instance of SubscriptionsServiceClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected SubscriptionsServiceClient(SubscriptionsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SubscriptionsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected SubscriptionsServiceClient(SubscriptionsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final SubscriptionsServiceSettings getSettings() { + return settings; + } + + public SubscriptionsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/create-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   Subscription subscription = Subscription.newBuilder().build();
+   *   Subscription response =
+   *       subscriptionsServiceClient.createSubscriptionAsync(subscription).get();
+   * }
+   * }
+ * + * @param subscription Required. The subscription resource to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSubscriptionAsync( + Subscription subscription) { + CreateSubscriptionRequest request = + CreateSubscriptionRequest.newBuilder().setSubscription(subscription).build(); + return createSubscriptionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/create-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   CreateSubscriptionRequest request =
+   *       CreateSubscriptionRequest.newBuilder()
+   *           .setSubscription(Subscription.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Subscription response = subscriptionsServiceClient.createSubscriptionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createSubscriptionAsync( + CreateSubscriptionRequest request) { + return createSubscriptionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/create-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   CreateSubscriptionRequest request =
+   *       CreateSubscriptionRequest.newBuilder()
+   *           .setSubscription(Subscription.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       subscriptionsServiceClient.createSubscriptionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Subscription response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata> + createSubscriptionOperationCallable() { + return stub.createSubscriptionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/create-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   CreateSubscriptionRequest request =
+   *       CreateSubscriptionRequest.newBuilder()
+   *           .setSubscription(Subscription.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       subscriptionsServiceClient.createSubscriptionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSubscriptionCallable() { + return stub.createSubscriptionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/delete-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+   *   subscriptionsServiceClient.deleteSubscriptionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Resource name of the subscription to delete. + *

Format: `subscriptions/{subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSubscriptionAsync( + SubscriptionName name) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteSubscriptionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/delete-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   String name = SubscriptionName.of("[SUBSCRIPTION]").toString();
+   *   subscriptionsServiceClient.deleteSubscriptionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Resource name of the subscription to delete. + *

Format: `subscriptions/{subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSubscriptionAsync( + String name) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder().setName(name).build(); + return deleteSubscriptionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/delete-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   DeleteSubscriptionRequest request =
+   *       DeleteSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   subscriptionsServiceClient.deleteSubscriptionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deleteSubscriptionAsync( + DeleteSubscriptionRequest request) { + return deleteSubscriptionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/delete-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   DeleteSubscriptionRequest request =
+   *       DeleteSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       subscriptionsServiceClient.deleteSubscriptionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteSubscriptionOperationCallable() { + return stub.deleteSubscriptionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google + * Workspace + * subscription](https://developers.google.com/workspace/events/guides/delete-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   DeleteSubscriptionRequest request =
+   *       DeleteSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       subscriptionsServiceClient.deleteSubscriptionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSubscriptionCallable() { + return stub.deleteSubscriptionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get + * details about a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/get-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+   *   Subscription response = subscriptionsServiceClient.getSubscription(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the subscription. + *

Format: `subscriptions/{subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Subscription getSubscription(SubscriptionName name) { + GetSubscriptionRequest request = + GetSubscriptionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get + * details about a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/get-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   String name = SubscriptionName.of("[SUBSCRIPTION]").toString();
+   *   Subscription response = subscriptionsServiceClient.getSubscription(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the subscription. + *

Format: `subscriptions/{subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Subscription getSubscription(String name) { + GetSubscriptionRequest request = GetSubscriptionRequest.newBuilder().setName(name).build(); + return getSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get + * details about a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/get-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   GetSubscriptionRequest request =
+   *       GetSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .build();
+   *   Subscription response = subscriptionsServiceClient.getSubscription(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Subscription getSubscription(GetSubscriptionRequest request) { + return getSubscriptionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get + * details about a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/get-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   GetSubscriptionRequest request =
+   *       GetSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       subscriptionsServiceClient.getSubscriptionCallable().futureCall(request);
+   *   // Do something.
+   *   Subscription response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSubscriptionCallable() { + return stub.getSubscriptionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google + * Workspace + * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   int pageSize = 883849137;
+   *   String pageToken = "pageToken873572522";
+   *   String filter = "filter-1274492040";
+   *   for (Subscription element :
+   *       subscriptionsServiceClient.listSubscriptions(pageSize, pageToken, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param pageSize Optional. The maximum number of subscriptions to return. The service might + * return fewer than this value. + *

If unspecified or set to `0`, up to 50 subscriptions are returned. + *

The maximum value is 100. If you specify a value more than 100, the system only returns + * 100 subscriptions. + * @param pageToken Optional. A page token, received from a previous list subscriptions call. + * Provide this parameter to retrieve the subsequent page. + *

When paginating, the filter value should match the call that provided the page token. + * Passing a different value might lead to unexpected results. + * @param filter Required. A query filter. + *

You can filter subscriptions by event type (`event_types`) and target resource + * (`target_resource`). + *

You must specify at least one event type in your query. To filter for multiple event + * types, use the `OR` operator. + *

To filter by both event type and target resource, use the `AND` operator and specify the + * full resource name, such as `//chat.googleapis.com/spaces/{space}`. + *

For example, the following queries are valid: + *

``` event_types:"google.workspace.chat.membership.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created" + *

event_types:"google.workspace.chat.message.v1.created" AND + * target_resource="//chat.googleapis.com/spaces/{space}" + *

( event_types:"google.workspace.chat.membership.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created" ) AND + * target_resource="//chat.googleapis.com/spaces/{space}" ``` + *

The server rejects invalid queries with an `INVALID_ARGUMENT` error. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSubscriptionsPagedResponse listSubscriptions( + int pageSize, String pageToken, String filter) { + ListSubscriptionsRequest request = + ListSubscriptionsRequest.newBuilder() + .setPageSize(pageSize) + .setPageToken(pageToken) + .setFilter(filter) + .build(); + return listSubscriptions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google + * Workspace + * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   ListSubscriptionsRequest request =
+   *       ListSubscriptionsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Subscription element :
+   *       subscriptionsServiceClient.listSubscriptions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsRequest request) { + return listSubscriptionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google + * Workspace + * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   ListSubscriptionsRequest request =
+   *       ListSubscriptionsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       subscriptionsServiceClient.listSubscriptionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Subscription element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSubscriptionsPagedCallable() { + return stub.listSubscriptionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google + * Workspace + * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   ListSubscriptionsRequest request =
+   *       ListSubscriptionsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListSubscriptionsResponse response =
+   *         subscriptionsServiceClient.listSubscriptionsCallable().call(request);
+   *     for (Subscription element : response.getSubscriptionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSubscriptionsCallable() { + return stub.listSubscriptionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update + * or renew a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/update-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   Subscription subscription = Subscription.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Subscription response =
+   *       subscriptionsServiceClient.updateSubscriptionAsync(subscription, updateMask).get();
+   * }
+   * }
+ * + * @param subscription Required. The subscription to update. + *

The subscription's `name` field is used to identify the subscription to update. + * @param updateMask Optional. Required. The field to update. + *

You can update one of the following fields in a subscription: + *

    + *
  • [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The + * timestamp when the subscription expires. + *
  • [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The time-to-live (TTL) + * or duration of the subscription. + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateSubscriptionAsync( + Subscription subscription, FieldMask updateMask) { + UpdateSubscriptionRequest request = + UpdateSubscriptionRequest.newBuilder() + .setSubscription(subscription) + .setUpdateMask(updateMask) + .build(); + return updateSubscriptionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update + * or renew a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/update-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   UpdateSubscriptionRequest request =
+   *       UpdateSubscriptionRequest.newBuilder()
+   *           .setSubscription(Subscription.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Subscription response = subscriptionsServiceClient.updateSubscriptionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture updateSubscriptionAsync( + UpdateSubscriptionRequest request) { + return updateSubscriptionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update + * or renew a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/update-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   UpdateSubscriptionRequest request =
+   *       UpdateSubscriptionRequest.newBuilder()
+   *           .setSubscription(Subscription.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       subscriptionsServiceClient.updateSubscriptionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Subscription response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata> + updateSubscriptionOperationCallable() { + return stub.updateSubscriptionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update + * or renew a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/update-subscription). + * + *

Sample code: + * + *

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

This method resets your subscription's `State` field to `ACTIVE`. Before you use this + * method, you must fix the error that suspended the subscription. To learn how to use this + * method, see [Reactivate a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+   *   Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Resource name of the subscription. + *

Format: `subscriptions/{subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + reactivateSubscriptionAsync(SubscriptionName name) { + ReactivateSubscriptionRequest request = + ReactivateSubscriptionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return reactivateSubscriptionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reactivates a suspended Google Workspace subscription. + * + *

This method resets your subscription's `State` field to `ACTIVE`. Before you use this + * method, you must fix the error that suspended the subscription. To learn how to use this + * method, see [Reactivate a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   String name = SubscriptionName.of("[SUBSCRIPTION]").toString();
+   *   Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Resource name of the subscription. + *

Format: `subscriptions/{subscription}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + reactivateSubscriptionAsync(String name) { + ReactivateSubscriptionRequest request = + ReactivateSubscriptionRequest.newBuilder().setName(name).build(); + return reactivateSubscriptionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reactivates a suspended Google Workspace subscription. + * + *

This method resets your subscription's `State` field to `ACTIVE`. Before you use this + * method, you must fix the error that suspended the subscription. To learn how to use this + * method, see [Reactivate a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   ReactivateSubscriptionRequest request =
+   *       ReactivateSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .build();
+   *   Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture + reactivateSubscriptionAsync(ReactivateSubscriptionRequest request) { + return reactivateSubscriptionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reactivates a suspended Google Workspace subscription. + * + *

This method resets your subscription's `State` field to `ACTIVE`. Before you use this + * method, you must fix the error that suspended the subscription. To learn how to use this + * method, see [Reactivate a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   ReactivateSubscriptionRequest request =
+   *       ReactivateSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       subscriptionsServiceClient.reactivateSubscriptionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Subscription response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationCallable() { + return stub.reactivateSubscriptionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reactivates a suspended Google Workspace subscription. + * + *

This method resets your subscription's `State` field to `ACTIVE`. Before you use this + * method, you must fix the error that suspended the subscription. To learn how to use this + * method, see [Reactivate a Google Workspace + * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SubscriptionsServiceClient subscriptionsServiceClient =
+   *     SubscriptionsServiceClient.create()) {
+   *   ReactivateSubscriptionRequest request =
+   *       ReactivateSubscriptionRequest.newBuilder()
+   *           .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       subscriptionsServiceClient.reactivateSubscriptionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + reactivateSubscriptionCallable() { + return stub.reactivateSubscriptionCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListSubscriptionsPagedResponse + extends AbstractPagedListResponse< + ListSubscriptionsRequest, + ListSubscriptionsResponse, + Subscription, + ListSubscriptionsPage, + ListSubscriptionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSubscriptionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSubscriptionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSubscriptionsPagedResponse(ListSubscriptionsPage page) { + super(page, ListSubscriptionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSubscriptionsPage + extends AbstractPage< + ListSubscriptionsRequest, + ListSubscriptionsResponse, + Subscription, + ListSubscriptionsPage> { + + private ListSubscriptionsPage( + PageContext context, + ListSubscriptionsResponse response) { + super(context, response); + } + + private static ListSubscriptionsPage createEmptyPage() { + return new ListSubscriptionsPage(null, null); + } + + @Override + protected ListSubscriptionsPage createPage( + PageContext context, + ListSubscriptionsResponse response) { + return new ListSubscriptionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSubscriptionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSubscriptionsRequest, + ListSubscriptionsResponse, + Subscription, + ListSubscriptionsPage, + ListSubscriptionsFixedSizeCollection> { + + private ListSubscriptionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSubscriptionsFixedSizeCollection createEmptyCollection() { + return new ListSubscriptionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSubscriptionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSubscriptionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceSettings.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceSettings.java new file mode 100644 index 000000000000..8389eb6a22d5 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceSettings.java @@ -0,0 +1,328 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1; + +import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.apps.events.subscriptions.v1.stub.SubscriptionsServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SubscriptionsServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (workspaceevents.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getSubscription to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SubscriptionsServiceSettings.Builder subscriptionsServiceSettingsBuilder =
+ *     SubscriptionsServiceSettings.newBuilder();
+ * subscriptionsServiceSettingsBuilder
+ *     .getSubscriptionSettings()
+ *     .setRetrySettings(
+ *         subscriptionsServiceSettingsBuilder
+ *             .getSubscriptionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SubscriptionsServiceSettings subscriptionsServiceSettings =
+ *     subscriptionsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SubscriptionsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSubscription. */ + public UnaryCallSettings createSubscriptionSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()).createSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to createSubscription. */ + public OperationCallSettings + createSubscriptionOperationSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()) + .createSubscriptionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteSubscription. */ + public UnaryCallSettings deleteSubscriptionSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()).deleteSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to deleteSubscription. */ + public OperationCallSettings + deleteSubscriptionOperationSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()) + .deleteSubscriptionOperationSettings(); + } + + /** Returns the object with the settings used for calls to getSubscription. */ + public UnaryCallSettings getSubscriptionSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()).getSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to listSubscriptions. */ + public PagedCallSettings< + ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> + listSubscriptionsSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()).listSubscriptionsSettings(); + } + + /** Returns the object with the settings used for calls to updateSubscription. */ + public UnaryCallSettings updateSubscriptionSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()).updateSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to updateSubscription. */ + public OperationCallSettings + updateSubscriptionOperationSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()) + .updateSubscriptionOperationSettings(); + } + + /** Returns the object with the settings used for calls to reactivateSubscription. */ + public UnaryCallSettings + reactivateSubscriptionSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()).reactivateSubscriptionSettings(); + } + + /** Returns the object with the settings used for calls to reactivateSubscription. */ + public OperationCallSettings< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationSettings() { + return ((SubscriptionsServiceStubSettings) getStubSettings()) + .reactivateSubscriptionOperationSettings(); + } + + public static final SubscriptionsServiceSettings create(SubscriptionsServiceStubSettings stub) + throws IOException { + return new SubscriptionsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SubscriptionsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SubscriptionsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SubscriptionsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SubscriptionsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SubscriptionsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SubscriptionsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SubscriptionsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SubscriptionsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SubscriptionsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SubscriptionsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SubscriptionsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SubscriptionsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SubscriptionsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SubscriptionsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SubscriptionsServiceStubSettings.newHttpJsonBuilder()); + } + + public SubscriptionsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SubscriptionsServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createSubscription. */ + public UnaryCallSettings.Builder + createSubscriptionSettings() { + return getStubSettingsBuilder().createSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to createSubscription. */ + public OperationCallSettings.Builder< + CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata> + createSubscriptionOperationSettings() { + return getStubSettingsBuilder().createSubscriptionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSubscription. */ + public UnaryCallSettings.Builder + deleteSubscriptionSettings() { + return getStubSettingsBuilder().deleteSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSubscription. */ + public OperationCallSettings.Builder< + DeleteSubscriptionRequest, Empty, DeleteSubscriptionMetadata> + deleteSubscriptionOperationSettings() { + return getStubSettingsBuilder().deleteSubscriptionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getSubscription. */ + public UnaryCallSettings.Builder + getSubscriptionSettings() { + return getStubSettingsBuilder().getSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to listSubscriptions. */ + public PagedCallSettings.Builder< + ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> + listSubscriptionsSettings() { + return getStubSettingsBuilder().listSubscriptionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateSubscription. */ + public UnaryCallSettings.Builder + updateSubscriptionSettings() { + return getStubSettingsBuilder().updateSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to updateSubscription. */ + public OperationCallSettings.Builder< + UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata> + updateSubscriptionOperationSettings() { + return getStubSettingsBuilder().updateSubscriptionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to reactivateSubscription. */ + public UnaryCallSettings.Builder + reactivateSubscriptionSettings() { + return getStubSettingsBuilder().reactivateSubscriptionSettings(); + } + + /** Returns the builder for the settings used for calls to reactivateSubscription. */ + public OperationCallSettings.Builder< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationSettings() { + return getStubSettingsBuilder().reactivateSubscriptionOperationSettings(); + } + + @Override + public SubscriptionsServiceSettings build() throws IOException { + return new SubscriptionsServiceSettings(this); + } + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/gapic_metadata.json b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/gapic_metadata.json new file mode 100644 index 000000000000..363f190e246e --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.apps.events.subscriptions.v1", + "libraryPackage": "com.google.apps.events.subscriptions.v1", + "services": { + "SubscriptionsService": { + "clients": { + "grpc": { + "libraryClient": "SubscriptionsServiceClient", + "rpcs": { + "CreateSubscription": { + "methods": ["createSubscriptionAsync", "createSubscriptionAsync", "createSubscriptionOperationCallable", "createSubscriptionCallable"] + }, + "DeleteSubscription": { + "methods": ["deleteSubscriptionAsync", "deleteSubscriptionAsync", "deleteSubscriptionAsync", "deleteSubscriptionOperationCallable", "deleteSubscriptionCallable"] + }, + "GetSubscription": { + "methods": ["getSubscription", "getSubscription", "getSubscription", "getSubscriptionCallable"] + }, + "ListSubscriptions": { + "methods": ["listSubscriptions", "listSubscriptions", "listSubscriptionsPagedCallable", "listSubscriptionsCallable"] + }, + "ReactivateSubscription": { + "methods": ["reactivateSubscriptionAsync", "reactivateSubscriptionAsync", "reactivateSubscriptionAsync", "reactivateSubscriptionOperationCallable", "reactivateSubscriptionCallable"] + }, + "UpdateSubscription": { + "methods": ["updateSubscriptionAsync", "updateSubscriptionAsync", "updateSubscriptionOperationCallable", "updateSubscriptionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/package-info.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/package-info.java new file mode 100644 index 000000000000..c28ce0a05200 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/package-info.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Google Workspace Events API + * + *

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

======================= SubscriptionsServiceClient ======================= + * + *

Service Description: A service that manages subscriptions to Google Workspace events. + * + *

Sample for SubscriptionsServiceClient: + * + *

{@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 (SubscriptionsServiceClient subscriptionsServiceClient =
+ *     SubscriptionsServiceClient.create()) {
+ *   SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+ *   Subscription response = subscriptionsServiceClient.getSubscription(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.apps.events.subscriptions.v1; + +import javax.annotation.Generated; diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceCallableFactory.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceCallableFactory.java new file mode 100644 index 000000000000..81a5b160e91d --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SubscriptionsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcSubscriptionsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceStub.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceStub.java new file mode 100644 index 000000000000..53c34b4bda32 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceStub.java @@ -0,0 +1,406 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.stub; + +import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SubscriptionsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcSubscriptionsServiceStub extends SubscriptionsServiceStub { + private static final MethodDescriptor + createSubscriptionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/CreateSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteSubscriptionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/DeleteSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getSubscriptionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/GetSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSubscriptionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/ListSubscriptions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSubscriptionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSubscriptionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateSubscriptionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/UpdateSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + reactivateSubscriptionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/ReactivateSubscription") + .setRequestMarshaller( + ProtoUtils.marshaller(ReactivateSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable createSubscriptionCallable; + private final OperationCallable< + CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata> + createSubscriptionOperationCallable; + private final UnaryCallable deleteSubscriptionCallable; + private final OperationCallable + deleteSubscriptionOperationCallable; + private final UnaryCallable getSubscriptionCallable; + private final UnaryCallable + listSubscriptionsCallable; + private final UnaryCallable + listSubscriptionsPagedCallable; + private final UnaryCallable updateSubscriptionCallable; + private final OperationCallable< + UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata> + updateSubscriptionOperationCallable; + private final UnaryCallable + reactivateSubscriptionCallable; + private final OperationCallable< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSubscriptionsServiceStub create(SubscriptionsServiceStubSettings settings) + throws IOException { + return new GrpcSubscriptionsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSubscriptionsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSubscriptionsServiceStub( + SubscriptionsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSubscriptionsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSubscriptionsServiceStub( + SubscriptionsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSubscriptionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcSubscriptionsServiceStub( + SubscriptionsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSubscriptionsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSubscriptionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcSubscriptionsServiceStub( + SubscriptionsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSubscriptionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSubscriptionMethodDescriptor) + .build(); + GrpcCallSettings deleteSubscriptionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getSubscriptionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listSubscriptionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSubscriptionsMethodDescriptor) + .build(); + GrpcCallSettings updateSubscriptionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "subscription.name", String.valueOf(request.getSubscription().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + reactivateSubscriptionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reactivateSubscriptionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createSubscriptionCallable = + callableFactory.createUnaryCallable( + createSubscriptionTransportSettings, + settings.createSubscriptionSettings(), + clientContext); + this.createSubscriptionOperationCallable = + callableFactory.createOperationCallable( + createSubscriptionTransportSettings, + settings.createSubscriptionOperationSettings(), + clientContext, + operationsStub); + this.deleteSubscriptionCallable = + callableFactory.createUnaryCallable( + deleteSubscriptionTransportSettings, + settings.deleteSubscriptionSettings(), + clientContext); + this.deleteSubscriptionOperationCallable = + callableFactory.createOperationCallable( + deleteSubscriptionTransportSettings, + settings.deleteSubscriptionOperationSettings(), + clientContext, + operationsStub); + this.getSubscriptionCallable = + callableFactory.createUnaryCallable( + getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext); + this.listSubscriptionsCallable = + callableFactory.createUnaryCallable( + listSubscriptionsTransportSettings, + settings.listSubscriptionsSettings(), + clientContext); + this.listSubscriptionsPagedCallable = + callableFactory.createPagedCallable( + listSubscriptionsTransportSettings, + settings.listSubscriptionsSettings(), + clientContext); + this.updateSubscriptionCallable = + callableFactory.createUnaryCallable( + updateSubscriptionTransportSettings, + settings.updateSubscriptionSettings(), + clientContext); + this.updateSubscriptionOperationCallable = + callableFactory.createOperationCallable( + updateSubscriptionTransportSettings, + settings.updateSubscriptionOperationSettings(), + clientContext, + operationsStub); + this.reactivateSubscriptionCallable = + callableFactory.createUnaryCallable( + reactivateSubscriptionTransportSettings, + settings.reactivateSubscriptionSettings(), + clientContext); + this.reactivateSubscriptionOperationCallable = + callableFactory.createOperationCallable( + reactivateSubscriptionTransportSettings, + settings.reactivateSubscriptionOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSubscriptionCallable() { + return createSubscriptionCallable; + } + + @Override + public OperationCallable + createSubscriptionOperationCallable() { + return createSubscriptionOperationCallable; + } + + @Override + public UnaryCallable deleteSubscriptionCallable() { + return deleteSubscriptionCallable; + } + + @Override + public OperationCallable + deleteSubscriptionOperationCallable() { + return deleteSubscriptionOperationCallable; + } + + @Override + public UnaryCallable getSubscriptionCallable() { + return getSubscriptionCallable; + } + + @Override + public UnaryCallable + listSubscriptionsCallable() { + return listSubscriptionsCallable; + } + + @Override + public UnaryCallable + listSubscriptionsPagedCallable() { + return listSubscriptionsPagedCallable; + } + + @Override + public UnaryCallable updateSubscriptionCallable() { + return updateSubscriptionCallable; + } + + @Override + public OperationCallable + updateSubscriptionOperationCallable() { + return updateSubscriptionOperationCallable; + } + + @Override + public UnaryCallable reactivateSubscriptionCallable() { + return reactivateSubscriptionCallable; + } + + @Override + public OperationCallable< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationCallable() { + return reactivateSubscriptionOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceCallableFactory.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceCallableFactory.java new file mode 100644 index 000000000000..2664d82c9eb8 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SubscriptionsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonSubscriptionsServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceStub.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceStub.java new file mode 100644 index 000000000000..ee8b3476517c --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceStub.java @@ -0,0 +1,632 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.stub; + +import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SubscriptionsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonSubscriptionsServiceStub extends SubscriptionsServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Subscription.getDescriptor()) + .add(UpdateSubscriptionMetadata.getDescriptor()) + .add(CreateSubscriptionMetadata.getDescriptor()) + .add(DeleteSubscriptionMetadata.getDescriptor()) + .add(ReactivateSubscriptionMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createSubscriptionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/CreateSubscription") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/subscriptions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("subscription", request.getSubscription(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSubscriptionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteSubscriptionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/DeleteSubscription") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=subscriptions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteSubscriptionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getSubscriptionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/GetSubscription") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=subscriptions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Subscription.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSubscriptionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/ListSubscriptions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/subscriptions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSubscriptionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateSubscriptionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/UpdateSubscription") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{subscription.name=subscriptions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "subscription.name", request.getSubscription().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("subscription", request.getSubscription(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateSubscriptionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + reactivateSubscriptionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.apps.events.subscriptions.v1.SubscriptionsService/ReactivateSubscription") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=subscriptions/*}:reactivate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ReactivateSubscriptionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable createSubscriptionCallable; + private final OperationCallable< + CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata> + createSubscriptionOperationCallable; + private final UnaryCallable deleteSubscriptionCallable; + private final OperationCallable + deleteSubscriptionOperationCallable; + private final UnaryCallable getSubscriptionCallable; + private final UnaryCallable + listSubscriptionsCallable; + private final UnaryCallable + listSubscriptionsPagedCallable; + private final UnaryCallable updateSubscriptionCallable; + private final OperationCallable< + UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata> + updateSubscriptionOperationCallable; + private final UnaryCallable + reactivateSubscriptionCallable; + private final OperationCallable< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSubscriptionsServiceStub create( + SubscriptionsServiceStubSettings settings) throws IOException { + return new HttpJsonSubscriptionsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSubscriptionsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSubscriptionsServiceStub( + SubscriptionsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSubscriptionsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSubscriptionsServiceStub( + SubscriptionsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSubscriptionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonSubscriptionsServiceStub( + SubscriptionsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSubscriptionsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSubscriptionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonSubscriptionsServiceStub( + SubscriptionsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1/{name=operations/**}").build()) + .build()); + + HttpJsonCallSettings createSubscriptionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSubscriptionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getSubscriptionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listSubscriptionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSubscriptionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateSubscriptionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "subscription.name", String.valueOf(request.getSubscription().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + reactivateSubscriptionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reactivateSubscriptionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createSubscriptionCallable = + callableFactory.createUnaryCallable( + createSubscriptionTransportSettings, + settings.createSubscriptionSettings(), + clientContext); + this.createSubscriptionOperationCallable = + callableFactory.createOperationCallable( + createSubscriptionTransportSettings, + settings.createSubscriptionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteSubscriptionCallable = + callableFactory.createUnaryCallable( + deleteSubscriptionTransportSettings, + settings.deleteSubscriptionSettings(), + clientContext); + this.deleteSubscriptionOperationCallable = + callableFactory.createOperationCallable( + deleteSubscriptionTransportSettings, + settings.deleteSubscriptionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getSubscriptionCallable = + callableFactory.createUnaryCallable( + getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext); + this.listSubscriptionsCallable = + callableFactory.createUnaryCallable( + listSubscriptionsTransportSettings, + settings.listSubscriptionsSettings(), + clientContext); + this.listSubscriptionsPagedCallable = + callableFactory.createPagedCallable( + listSubscriptionsTransportSettings, + settings.listSubscriptionsSettings(), + clientContext); + this.updateSubscriptionCallable = + callableFactory.createUnaryCallable( + updateSubscriptionTransportSettings, + settings.updateSubscriptionSettings(), + clientContext); + this.updateSubscriptionOperationCallable = + callableFactory.createOperationCallable( + updateSubscriptionTransportSettings, + settings.updateSubscriptionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.reactivateSubscriptionCallable = + callableFactory.createUnaryCallable( + reactivateSubscriptionTransportSettings, + settings.reactivateSubscriptionSettings(), + clientContext); + this.reactivateSubscriptionOperationCallable = + callableFactory.createOperationCallable( + reactivateSubscriptionTransportSettings, + settings.reactivateSubscriptionOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSubscriptionMethodDescriptor); + methodDescriptors.add(deleteSubscriptionMethodDescriptor); + methodDescriptors.add(getSubscriptionMethodDescriptor); + methodDescriptors.add(listSubscriptionsMethodDescriptor); + methodDescriptors.add(updateSubscriptionMethodDescriptor); + methodDescriptors.add(reactivateSubscriptionMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createSubscriptionCallable() { + return createSubscriptionCallable; + } + + @Override + public OperationCallable + createSubscriptionOperationCallable() { + return createSubscriptionOperationCallable; + } + + @Override + public UnaryCallable deleteSubscriptionCallable() { + return deleteSubscriptionCallable; + } + + @Override + public OperationCallable + deleteSubscriptionOperationCallable() { + return deleteSubscriptionOperationCallable; + } + + @Override + public UnaryCallable getSubscriptionCallable() { + return getSubscriptionCallable; + } + + @Override + public UnaryCallable + listSubscriptionsCallable() { + return listSubscriptionsCallable; + } + + @Override + public UnaryCallable + listSubscriptionsPagedCallable() { + return listSubscriptionsPagedCallable; + } + + @Override + public UnaryCallable updateSubscriptionCallable() { + return updateSubscriptionCallable; + } + + @Override + public OperationCallable + updateSubscriptionOperationCallable() { + return updateSubscriptionOperationCallable; + } + + @Override + public UnaryCallable reactivateSubscriptionCallable() { + return reactivateSubscriptionCallable; + } + + @Override + public OperationCallable< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationCallable() { + return reactivateSubscriptionOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStub.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStub.java new file mode 100644 index 000000000000..48041c4eb6ee --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStub.java @@ -0,0 +1,115 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.stub; + +import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SubscriptionsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class SubscriptionsServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable + createSubscriptionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSubscriptionOperationCallable()"); + } + + public UnaryCallable createSubscriptionCallable() { + throw new UnsupportedOperationException("Not implemented: createSubscriptionCallable()"); + } + + public OperationCallable + deleteSubscriptionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteSubscriptionOperationCallable()"); + } + + public UnaryCallable deleteSubscriptionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSubscriptionCallable()"); + } + + public UnaryCallable getSubscriptionCallable() { + throw new UnsupportedOperationException("Not implemented: getSubscriptionCallable()"); + } + + public UnaryCallable + listSubscriptionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSubscriptionsPagedCallable()"); + } + + public UnaryCallable + listSubscriptionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSubscriptionsCallable()"); + } + + public OperationCallable + updateSubscriptionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateSubscriptionOperationCallable()"); + } + + public UnaryCallable updateSubscriptionCallable() { + throw new UnsupportedOperationException("Not implemented: updateSubscriptionCallable()"); + } + + public OperationCallable< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: reactivateSubscriptionOperationCallable()"); + } + + public UnaryCallable reactivateSubscriptionCallable() { + throw new UnsupportedOperationException("Not implemented: reactivateSubscriptionCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStubSettings.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStubSettings.java new file mode 100644 index 000000000000..d96311afe755 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStubSettings.java @@ -0,0 +1,785 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.stub; + +import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest; +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.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SubscriptionsServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (workspaceevents.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getSubscription to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SubscriptionsServiceStubSettings.Builder subscriptionsServiceSettingsBuilder =
+ *     SubscriptionsServiceStubSettings.newBuilder();
+ * subscriptionsServiceSettingsBuilder
+ *     .getSubscriptionSettings()
+ *     .setRetrySettings(
+ *         subscriptionsServiceSettingsBuilder
+ *             .getSubscriptionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SubscriptionsServiceStubSettings subscriptionsServiceSettings =
+ *     subscriptionsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SubscriptionsServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/chat.bot") + .add("https://www.googleapis.com/auth/chat.memberships") + .add("https://www.googleapis.com/auth/chat.memberships.readonly") + .add("https://www.googleapis.com/auth/chat.messages") + .add("https://www.googleapis.com/auth/chat.messages.reactions") + .add("https://www.googleapis.com/auth/chat.messages.reactions.readonly") + .add("https://www.googleapis.com/auth/chat.messages.readonly") + .add("https://www.googleapis.com/auth/chat.spaces") + .add("https://www.googleapis.com/auth/chat.spaces.readonly") + .add("https://www.googleapis.com/auth/meetings.space.created") + .add("https://www.googleapis.com/auth/meetings.space.readonly") + .build(); + + private final UnaryCallSettings createSubscriptionSettings; + private final OperationCallSettings< + CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata> + createSubscriptionOperationSettings; + private final UnaryCallSettings deleteSubscriptionSettings; + private final OperationCallSettings + deleteSubscriptionOperationSettings; + private final UnaryCallSettings getSubscriptionSettings; + private final PagedCallSettings< + ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> + listSubscriptionsSettings; + private final UnaryCallSettings updateSubscriptionSettings; + private final OperationCallSettings< + UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata> + updateSubscriptionOperationSettings; + private final UnaryCallSettings + reactivateSubscriptionSettings; + private final OperationCallSettings< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationSettings; + + private static final PagedListDescriptor< + ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription> + LIST_SUBSCRIPTIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSubscriptionsRequest injectToken( + ListSubscriptionsRequest payload, String token) { + return ListSubscriptionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSubscriptionsRequest injectPageSize( + ListSubscriptionsRequest payload, int pageSize) { + return ListSubscriptionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSubscriptionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSubscriptionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSubscriptionsResponse payload) { + return payload.getSubscriptionsList() == null + ? ImmutableList.of() + : payload.getSubscriptionsList(); + } + }; + + private static final PagedListResponseFactory< + ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> + LIST_SUBSCRIPTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSubscriptionsRequest, + ListSubscriptionsResponse, + ListSubscriptionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSubscriptionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SUBSCRIPTIONS_PAGE_STR_DESC, request, context); + return ListSubscriptionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSubscription. */ + public UnaryCallSettings createSubscriptionSettings() { + return createSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to createSubscription. */ + public OperationCallSettings + createSubscriptionOperationSettings() { + return createSubscriptionOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteSubscription. */ + public UnaryCallSettings deleteSubscriptionSettings() { + return deleteSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to deleteSubscription. */ + public OperationCallSettings + deleteSubscriptionOperationSettings() { + return deleteSubscriptionOperationSettings; + } + + /** Returns the object with the settings used for calls to getSubscription. */ + public UnaryCallSettings getSubscriptionSettings() { + return getSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to listSubscriptions. */ + public PagedCallSettings< + ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> + listSubscriptionsSettings() { + return listSubscriptionsSettings; + } + + /** Returns the object with the settings used for calls to updateSubscription. */ + public UnaryCallSettings updateSubscriptionSettings() { + return updateSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to updateSubscription. */ + public OperationCallSettings + updateSubscriptionOperationSettings() { + return updateSubscriptionOperationSettings; + } + + /** Returns the object with the settings used for calls to reactivateSubscription. */ + public UnaryCallSettings + reactivateSubscriptionSettings() { + return reactivateSubscriptionSettings; + } + + /** Returns the object with the settings used for calls to reactivateSubscription. */ + public OperationCallSettings< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationSettings() { + return reactivateSubscriptionOperationSettings; + } + + public SubscriptionsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSubscriptionsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSubscriptionsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "workspaceevents"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "workspaceevents.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "workspaceevents.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SubscriptionsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SubscriptionsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SubscriptionsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SubscriptionsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSubscriptionSettings = settingsBuilder.createSubscriptionSettings().build(); + createSubscriptionOperationSettings = + settingsBuilder.createSubscriptionOperationSettings().build(); + deleteSubscriptionSettings = settingsBuilder.deleteSubscriptionSettings().build(); + deleteSubscriptionOperationSettings = + settingsBuilder.deleteSubscriptionOperationSettings().build(); + getSubscriptionSettings = settingsBuilder.getSubscriptionSettings().build(); + listSubscriptionsSettings = settingsBuilder.listSubscriptionsSettings().build(); + updateSubscriptionSettings = settingsBuilder.updateSubscriptionSettings().build(); + updateSubscriptionOperationSettings = + settingsBuilder.updateSubscriptionOperationSettings().build(); + reactivateSubscriptionSettings = settingsBuilder.reactivateSubscriptionSettings().build(); + reactivateSubscriptionOperationSettings = + settingsBuilder.reactivateSubscriptionOperationSettings().build(); + } + + /** Builder for SubscriptionsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createSubscriptionSettings; + private final OperationCallSettings.Builder< + CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata> + createSubscriptionOperationSettings; + private final UnaryCallSettings.Builder + deleteSubscriptionSettings; + private final OperationCallSettings.Builder< + DeleteSubscriptionRequest, Empty, DeleteSubscriptionMetadata> + deleteSubscriptionOperationSettings; + private final UnaryCallSettings.Builder + getSubscriptionSettings; + private final PagedCallSettings.Builder< + ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> + listSubscriptionsSettings; + private final UnaryCallSettings.Builder + updateSubscriptionSettings; + private final OperationCallSettings.Builder< + UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata> + updateSubscriptionOperationSettings; + private final UnaryCallSettings.Builder + reactivateSubscriptionSettings; + private final OperationCallSettings.Builder< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSubscriptionOperationSettings = OperationCallSettings.newBuilder(); + deleteSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSubscriptionOperationSettings = OperationCallSettings.newBuilder(); + getSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSubscriptionsSettings = PagedCallSettings.newBuilder(LIST_SUBSCRIPTIONS_PAGE_STR_FACT); + updateSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSubscriptionOperationSettings = OperationCallSettings.newBuilder(); + reactivateSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reactivateSubscriptionOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSubscriptionSettings, + deleteSubscriptionSettings, + getSubscriptionSettings, + listSubscriptionsSettings, + updateSubscriptionSettings, + reactivateSubscriptionSettings); + initDefaults(this); + } + + protected Builder(SubscriptionsServiceStubSettings settings) { + super(settings); + + createSubscriptionSettings = settings.createSubscriptionSettings.toBuilder(); + createSubscriptionOperationSettings = + settings.createSubscriptionOperationSettings.toBuilder(); + deleteSubscriptionSettings = settings.deleteSubscriptionSettings.toBuilder(); + deleteSubscriptionOperationSettings = + settings.deleteSubscriptionOperationSettings.toBuilder(); + getSubscriptionSettings = settings.getSubscriptionSettings.toBuilder(); + listSubscriptionsSettings = settings.listSubscriptionsSettings.toBuilder(); + updateSubscriptionSettings = settings.updateSubscriptionSettings.toBuilder(); + updateSubscriptionOperationSettings = + settings.updateSubscriptionOperationSettings.toBuilder(); + reactivateSubscriptionSettings = settings.reactivateSubscriptionSettings.toBuilder(); + reactivateSubscriptionOperationSettings = + settings.reactivateSubscriptionOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSubscriptionSettings, + deleteSubscriptionSettings, + getSubscriptionSettings, + listSubscriptionsSettings, + updateSubscriptionSettings, + reactivateSubscriptionSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listSubscriptionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .reactivateSubscriptionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createSubscriptionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Subscription.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateSubscriptionMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteSubscriptionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + DeleteSubscriptionMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateSubscriptionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Subscription.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UpdateSubscriptionMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .reactivateSubscriptionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Subscription.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + ReactivateSubscriptionMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSubscription. */ + public UnaryCallSettings.Builder + createSubscriptionSettings() { + return createSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to createSubscription. */ + public OperationCallSettings.Builder< + CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata> + createSubscriptionOperationSettings() { + return createSubscriptionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteSubscription. */ + public UnaryCallSettings.Builder + deleteSubscriptionSettings() { + return deleteSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to deleteSubscription. */ + public OperationCallSettings.Builder< + DeleteSubscriptionRequest, Empty, DeleteSubscriptionMetadata> + deleteSubscriptionOperationSettings() { + return deleteSubscriptionOperationSettings; + } + + /** Returns the builder for the settings used for calls to getSubscription. */ + public UnaryCallSettings.Builder + getSubscriptionSettings() { + return getSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to listSubscriptions. */ + public PagedCallSettings.Builder< + ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> + listSubscriptionsSettings() { + return listSubscriptionsSettings; + } + + /** Returns the builder for the settings used for calls to updateSubscription. */ + public UnaryCallSettings.Builder + updateSubscriptionSettings() { + return updateSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to updateSubscription. */ + public OperationCallSettings.Builder< + UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata> + updateSubscriptionOperationSettings() { + return updateSubscriptionOperationSettings; + } + + /** Returns the builder for the settings used for calls to reactivateSubscription. */ + public UnaryCallSettings.Builder + reactivateSubscriptionSettings() { + return reactivateSubscriptionSettings; + } + + /** Returns the builder for the settings used for calls to reactivateSubscription. */ + public OperationCallSettings.Builder< + ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata> + reactivateSubscriptionOperationSettings() { + return reactivateSubscriptionOperationSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public SubscriptionsServiceStubSettings build() throws IOException { + return new SubscriptionsServiceStubSettings(this); + } + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/resources/META-INF/native-image/com.google.apps.events.subscriptions.v1/reflect-config.json b/java-workspaceevents/google-cloud-workspaceevents/src/main/resources/META-INF/native-image/com.google.apps.events.subscriptions.v1/reflect-config.json new file mode 100644 index 000000000000..c0ebdf0bb203 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/resources/META-INF/native-image/com.google.apps.events.subscriptions.v1/reflect-config.json @@ -0,0 +1,1631 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.GetSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.GetSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.NotificationEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.NotificationEndpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.PayloadOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.PayloadOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.Subscription", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.Subscription$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.Subscription$ErrorType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.Subscription$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/MockSubscriptionsService.java b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/MockSubscriptionsService.java new file mode 100644 index 000000000000..ee7ad6a0d795 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/MockSubscriptionsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.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 MockSubscriptionsService implements MockGrpcService { + private final MockSubscriptionsServiceImpl serviceImpl; + + public MockSubscriptionsService() { + serviceImpl = new MockSubscriptionsServiceImpl(); + } + + @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-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/MockSubscriptionsServiceImpl.java b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/MockSubscriptionsServiceImpl.java new file mode 100644 index 000000000000..9d998b2abdea --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/MockSubscriptionsServiceImpl.java @@ -0,0 +1,188 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1; + +import com.google.api.core.BetaApi; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceGrpc.SubscriptionsServiceImplBase; +import com.google.longrunning.Operation; +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 MockSubscriptionsServiceImpl extends SubscriptionsServiceImplBase { + private List requests; + private Queue responses; + + public MockSubscriptionsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createSubscription( + CreateSubscriptionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSubscription( + DeleteSubscriptionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSubscription( + GetSubscriptionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Subscription) { + requests.add(request); + responseObserver.onNext(((Subscription) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Subscription.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSubscriptions( + ListSubscriptionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSubscriptionsResponse) { + requests.add(request); + responseObserver.onNext(((ListSubscriptionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListSubscriptions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSubscriptionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSubscription( + UpdateSubscriptionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reactivateSubscription( + ReactivateSubscriptionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 ReactivateSubscription, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClientHttpJsonTest.java b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..8bc4f2385566 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClientHttpJsonTest.java @@ -0,0 +1,601 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1; + +import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.apps.events.subscriptions.v1.stub.HttpJsonSubscriptionsServiceStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SubscriptionsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SubscriptionsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSubscriptionsServiceStub.getMethodDescriptors(), + SubscriptionsServiceSettings.getDefaultEndpoint()); + SubscriptionsServiceSettings settings = + SubscriptionsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SubscriptionsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SubscriptionsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Subscription subscription = Subscription.newBuilder().build(); + + Subscription actualResponse = client.createSubscriptionAsync(subscription).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Subscription subscription = Subscription.newBuilder().build(); + client.createSubscriptionAsync(subscription).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteSubscriptionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + + client.deleteSubscriptionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + client.deleteSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteSubscriptionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "subscriptions/subscription-922"; + + client.deleteSubscriptionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSubscriptionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "subscriptions/subscription-922"; + client.deleteSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + + Subscription actualResponse = client.getSubscription(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 getSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + client.getSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSubscriptionTest2() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String name = "subscriptions/subscription-922"; + + Subscription actualResponse = client.getSubscription(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 getSubscriptionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "subscriptions/subscription-922"; + client.getSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSubscriptionsTest() throws Exception { + Subscription responsesElement = Subscription.newBuilder().build(); + ListSubscriptionsResponse expectedResponse = + ListSubscriptionsResponse.newBuilder() + .setNextPageToken("") + .addAllSubscriptions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + int pageSize = 883849137; + String pageToken = "pageToken873572522"; + String filter = "filter-1274492040"; + + ListSubscriptionsPagedResponse pagedListResponse = + client.listSubscriptions(pageSize, pageToken, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSubscriptionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + int pageSize = 883849137; + String pageToken = "pageToken873572522"; + String filter = "filter-1274492040"; + client.listSubscriptions(pageSize, pageToken, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Subscription subscription = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Subscription actualResponse = client.updateSubscriptionAsync(subscription, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Subscription subscription = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSubscriptionAsync(subscription, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void reactivateSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reactivateSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + + Subscription actualResponse = client.reactivateSubscriptionAsync(name).get(); + 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 reactivateSubscriptionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + client.reactivateSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void reactivateSubscriptionTest2() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reactivateSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "subscriptions/subscription-922"; + + Subscription actualResponse = client.reactivateSubscriptionAsync(name).get(); + 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 reactivateSubscriptionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "subscriptions/subscription-922"; + client.reactivateSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClientTest.java b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClientTest.java new file mode 100644 index 000000000000..d44e41b13fe1 --- /dev/null +++ b/java-workspaceevents/google-cloud-workspaceevents/src/test/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceClientTest.java @@ -0,0 +1,548 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1; + +import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SubscriptionsServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockSubscriptionsService mockSubscriptionsService; + private LocalChannelProvider channelProvider; + private SubscriptionsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSubscriptionsService = new MockSubscriptionsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSubscriptionsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SubscriptionsServiceSettings settings = + SubscriptionsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SubscriptionsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSubscriptionsService.addResponse(resultOperation); + + Subscription subscription = Subscription.newBuilder().build(); + + Subscription actualResponse = client.createSubscriptionAsync(subscription).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSubscriptionRequest actualRequest = ((CreateSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(subscription, actualRequest.getSubscription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + Subscription subscription = Subscription.newBuilder().build(); + client.createSubscriptionAsync(subscription).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteSubscriptionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSubscriptionsService.addResponse(resultOperation); + + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + + client.deleteSubscriptionAsync(name).get(); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSubscriptionRequest actualRequest = ((DeleteSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + client.deleteSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteSubscriptionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSubscriptionsService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteSubscriptionAsync(name).get(); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSubscriptionRequest actualRequest = ((DeleteSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSubscriptionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + mockSubscriptionsService.addResponse(expectedResponse); + + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + + Subscription actualResponse = client.getSubscription(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSubscriptionRequest actualRequest = ((GetSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + client.getSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSubscriptionTest2() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + mockSubscriptionsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Subscription actualResponse = client.getSubscription(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSubscriptionRequest actualRequest = ((GetSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSubscriptionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + String name = "name3373707"; + client.getSubscription(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSubscriptionsTest() throws Exception { + Subscription responsesElement = Subscription.newBuilder().build(); + ListSubscriptionsResponse expectedResponse = + ListSubscriptionsResponse.newBuilder() + .setNextPageToken("") + .addAllSubscriptions(Arrays.asList(responsesElement)) + .build(); + mockSubscriptionsService.addResponse(expectedResponse); + + int pageSize = 883849137; + String pageToken = "pageToken873572522"; + String filter = "filter-1274492040"; + + ListSubscriptionsPagedResponse pagedListResponse = + client.listSubscriptions(pageSize, pageToken, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSubscriptionsRequest actualRequest = ((ListSubscriptionsRequest) actualRequests.get(0)); + + Assert.assertEquals(pageSize, actualRequest.getPageSize()); + Assert.assertEquals(pageToken, actualRequest.getPageToken()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSubscriptionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + int pageSize = 883849137; + String pageToken = "pageToken873572522"; + String filter = "filter-1274492040"; + client.listSubscriptions(pageSize, pageToken, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSubscriptionsService.addResponse(resultOperation); + + Subscription subscription = Subscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Subscription actualResponse = client.updateSubscriptionAsync(subscription, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSubscriptionRequest actualRequest = ((UpdateSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(subscription, actualRequest.getSubscription()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + Subscription subscription = Subscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSubscriptionAsync(subscription, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void reactivateSubscriptionTest() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reactivateSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSubscriptionsService.addResponse(resultOperation); + + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + + Subscription actualResponse = client.reactivateSubscriptionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReactivateSubscriptionRequest actualRequest = + ((ReactivateSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reactivateSubscriptionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + client.reactivateSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void reactivateSubscriptionTest2() throws Exception { + Subscription expectedResponse = + Subscription.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setUid("uid115792") + .setTargetResource("targetResource-1933150017") + .addAllEventTypes(new ArrayList()) + .setPayloadOptions(PayloadOptions.newBuilder().build()) + .setNotificationEndpoint(NotificationEndpoint.newBuilder().build()) + .setAuthority("authority1475610435") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setReconciling(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reactivateSubscriptionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSubscriptionsService.addResponse(resultOperation); + + String name = "name3373707"; + + Subscription actualResponse = client.reactivateSubscriptionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSubscriptionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReactivateSubscriptionRequest actualRequest = + ((ReactivateSubscriptionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reactivateSubscriptionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSubscriptionsService.addException(exception); + + try { + String name = "name3373707"; + client.reactivateSubscriptionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-workspaceevents/grpc-google-cloud-workspaceevents-v1/pom.xml b/java-workspaceevents/grpc-google-cloud-workspaceevents-v1/pom.xml new file mode 100644 index 000000000000..4f55b89d6a69 --- /dev/null +++ b/java-workspaceevents/grpc-google-cloud-workspaceevents-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-workspaceevents-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-workspaceevents-v1 + GRPC library for google-cloud-workspaceevents + + com.google.cloud + google-cloud-workspaceevents-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-workspaceevents-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-workspaceevents/grpc-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceGrpc.java b/java-workspaceevents/grpc-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceGrpc.java new file mode 100644 index 000000000000..e903ab6e9d8f --- /dev/null +++ b/java-workspaceevents/grpc-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceGrpc.java @@ -0,0 +1,1045 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * A service that manages subscriptions to Google Workspace events.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/apps/events/subscriptions/v1/subscriptions_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SubscriptionsServiceGrpc { + + private SubscriptionsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.apps.events.subscriptions.v1.SubscriptionsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest, + com.google.longrunning.Operation> + getCreateSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSubscription", + requestType = com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest, + com.google.longrunning.Operation> + getCreateSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest, + com.google.longrunning.Operation> + getCreateSubscriptionMethod; + if ((getCreateSubscriptionMethod = SubscriptionsServiceGrpc.getCreateSubscriptionMethod) + == null) { + synchronized (SubscriptionsServiceGrpc.class) { + if ((getCreateSubscriptionMethod = SubscriptionsServiceGrpc.getCreateSubscriptionMethod) + == null) { + SubscriptionsServiceGrpc.getCreateSubscriptionMethod = + getCreateSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriptionsServiceMethodDescriptorSupplier("CreateSubscription")) + .build(); + } + } + } + return getCreateSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest, + com.google.longrunning.Operation> + getDeleteSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSubscription", + requestType = com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest, + com.google.longrunning.Operation> + getDeleteSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest, + com.google.longrunning.Operation> + getDeleteSubscriptionMethod; + if ((getDeleteSubscriptionMethod = SubscriptionsServiceGrpc.getDeleteSubscriptionMethod) + == null) { + synchronized (SubscriptionsServiceGrpc.class) { + if ((getDeleteSubscriptionMethod = SubscriptionsServiceGrpc.getDeleteSubscriptionMethod) + == null) { + SubscriptionsServiceGrpc.getDeleteSubscriptionMethod = + getDeleteSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriptionsServiceMethodDescriptorSupplier("DeleteSubscription")) + .build(); + } + } + } + return getDeleteSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest, + com.google.apps.events.subscriptions.v1.Subscription> + getGetSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSubscription", + requestType = com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.class, + responseType = com.google.apps.events.subscriptions.v1.Subscription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest, + com.google.apps.events.subscriptions.v1.Subscription> + getGetSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest, + com.google.apps.events.subscriptions.v1.Subscription> + getGetSubscriptionMethod; + if ((getGetSubscriptionMethod = SubscriptionsServiceGrpc.getGetSubscriptionMethod) == null) { + synchronized (SubscriptionsServiceGrpc.class) { + if ((getGetSubscriptionMethod = SubscriptionsServiceGrpc.getGetSubscriptionMethod) + == null) { + SubscriptionsServiceGrpc.getGetSubscriptionMethod = + getGetSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.Subscription + .getDefaultInstance())) + .setSchemaDescriptor( + new SubscriptionsServiceMethodDescriptorSupplier("GetSubscription")) + .build(); + } + } + } + return getGetSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest, + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse> + getListSubscriptionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSubscriptions", + requestType = com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.class, + responseType = com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest, + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse> + getListSubscriptionsMethod() { + io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest, + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse> + getListSubscriptionsMethod; + if ((getListSubscriptionsMethod = SubscriptionsServiceGrpc.getListSubscriptionsMethod) + == null) { + synchronized (SubscriptionsServiceGrpc.class) { + if ((getListSubscriptionsMethod = SubscriptionsServiceGrpc.getListSubscriptionsMethod) + == null) { + SubscriptionsServiceGrpc.getListSubscriptionsMethod = + getListSubscriptionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSubscriptions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SubscriptionsServiceMethodDescriptorSupplier("ListSubscriptions")) + .build(); + } + } + } + return getListSubscriptionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest, + com.google.longrunning.Operation> + getUpdateSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSubscription", + requestType = com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest, + com.google.longrunning.Operation> + getUpdateSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest, + com.google.longrunning.Operation> + getUpdateSubscriptionMethod; + if ((getUpdateSubscriptionMethod = SubscriptionsServiceGrpc.getUpdateSubscriptionMethod) + == null) { + synchronized (SubscriptionsServiceGrpc.class) { + if ((getUpdateSubscriptionMethod = SubscriptionsServiceGrpc.getUpdateSubscriptionMethod) + == null) { + SubscriptionsServiceGrpc.getUpdateSubscriptionMethod = + getUpdateSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriptionsServiceMethodDescriptorSupplier("UpdateSubscription")) + .build(); + } + } + } + return getUpdateSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest, + com.google.longrunning.Operation> + getReactivateSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReactivateSubscription", + requestType = com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest, + com.google.longrunning.Operation> + getReactivateSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest, + com.google.longrunning.Operation> + getReactivateSubscriptionMethod; + if ((getReactivateSubscriptionMethod = SubscriptionsServiceGrpc.getReactivateSubscriptionMethod) + == null) { + synchronized (SubscriptionsServiceGrpc.class) { + if ((getReactivateSubscriptionMethod = + SubscriptionsServiceGrpc.getReactivateSubscriptionMethod) + == null) { + SubscriptionsServiceGrpc.getReactivateSubscriptionMethod = + getReactivateSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ReactivateSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriptionsServiceMethodDescriptorSupplier( + "ReactivateSubscription")) + .build(); + } + } + } + return getReactivateSubscriptionMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SubscriptionsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SubscriptionsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SubscriptionsServiceStub(channel, callOptions); + } + }; + return SubscriptionsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SubscriptionsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SubscriptionsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SubscriptionsServiceBlockingStub(channel, callOptions); + } + }; + return SubscriptionsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SubscriptionsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SubscriptionsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SubscriptionsServiceFutureStub(channel, callOptions); + } + }; + return SubscriptionsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * A service that manages subscriptions to Google Workspace events.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a Google Workspace subscription. To learn how to use this
+     * method, see [Create a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/create-subscription).
+     * 
+ */ + default void createSubscription( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a Google Workspace subscription.
+     * To learn how to use this method, see [Delete a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+     * 
+ */ + default void deleteSubscription( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details about a Google Workspace subscription. To learn how to use
+     * this method, see [Get details about a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+     * 
+ */ + default void getSubscription( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Google Workspace subscriptions. To learn how to use this method, see
+     * [List Google Workspace
+     * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+     * 
+ */ + default void listSubscriptions( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest request, + io.grpc.stub.StreamObserver< + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSubscriptionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates or renews a Google Workspace subscription. To learn how to use this
+     * method, see [Update or renew a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+     * 
+ */ + default void updateSubscription( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSubscriptionMethod(), responseObserver); + } + + /** + * + * + *
+     * Reactivates a suspended Google Workspace subscription.
+     * This method resets your subscription's `State` field to `ACTIVE`. Before
+     * you use this method, you must fix the error that suspended the
+     * subscription. To learn how to use this method, see [Reactivate a Google
+     * Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+     * 
+ */ + default void reactivateSubscription( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReactivateSubscriptionMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SubscriptionsService. + * + *
+   * A service that manages subscriptions to Google Workspace events.
+   * 
+ */ + public abstract static class SubscriptionsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SubscriptionsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SubscriptionsService. + * + *
+   * A service that manages subscriptions to Google Workspace events.
+   * 
+ */ + public static final class SubscriptionsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SubscriptionsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SubscriptionsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SubscriptionsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Google Workspace subscription. To learn how to use this
+     * method, see [Create a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/create-subscription).
+     * 
+ */ + public void createSubscription( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a Google Workspace subscription.
+     * To learn how to use this method, see [Delete a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+     * 
+ */ + public void deleteSubscription( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details about a Google Workspace subscription. To learn how to use
+     * this method, see [Get details about a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+     * 
+ */ + public void getSubscription( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Google Workspace subscriptions. To learn how to use this method, see
+     * [List Google Workspace
+     * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+     * 
+ */ + public void listSubscriptions( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest request, + io.grpc.stub.StreamObserver< + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSubscriptionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates or renews a Google Workspace subscription. To learn how to use this
+     * method, see [Update or renew a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+     * 
+ */ + public void updateSubscription( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reactivates a suspended Google Workspace subscription.
+     * This method resets your subscription's `State` field to `ACTIVE`. Before
+     * you use this method, you must fix the error that suspended the
+     * subscription. To learn how to use this method, see [Reactivate a Google
+     * Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+     * 
+ */ + public void reactivateSubscription( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReactivateSubscriptionMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SubscriptionsService. + * + *
+   * A service that manages subscriptions to Google Workspace events.
+   * 
+ */ + public static final class SubscriptionsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SubscriptionsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SubscriptionsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SubscriptionsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Google Workspace subscription. To learn how to use this
+     * method, see [Create a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/create-subscription).
+     * 
+ */ + public com.google.longrunning.Operation createSubscription( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Google Workspace subscription.
+     * To learn how to use this method, see [Delete a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+     * 
+ */ + public com.google.longrunning.Operation deleteSubscription( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details about a Google Workspace subscription. To learn how to use
+     * this method, see [Get details about a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+     * 
+ */ + public com.google.apps.events.subscriptions.v1.Subscription getSubscription( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Google Workspace subscriptions. To learn how to use this method, see
+     * [List Google Workspace
+     * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+     * 
+ */ + public com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse listSubscriptions( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSubscriptionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates or renews a Google Workspace subscription. To learn how to use this
+     * method, see [Update or renew a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+     * 
+ */ + public com.google.longrunning.Operation updateSubscription( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSubscriptionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reactivates a suspended Google Workspace subscription.
+     * This method resets your subscription's `State` field to `ACTIVE`. Before
+     * you use this method, you must fix the error that suspended the
+     * subscription. To learn how to use this method, see [Reactivate a Google
+     * Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+     * 
+ */ + public com.google.longrunning.Operation reactivateSubscription( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReactivateSubscriptionMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SubscriptionsService. + * + *
+   * A service that manages subscriptions to Google Workspace events.
+   * 
+ */ + public static final class SubscriptionsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SubscriptionsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SubscriptionsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SubscriptionsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Google Workspace subscription. To learn how to use this
+     * method, see [Create a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/create-subscription).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSubscription( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSubscriptionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a Google Workspace subscription.
+     * To learn how to use this method, see [Delete a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSubscription( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSubscriptionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details about a Google Workspace subscription. To learn how to use
+     * this method, see [Get details about a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.apps.events.subscriptions.v1.Subscription> + getSubscription(com.google.apps.events.subscriptions.v1.GetSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSubscriptionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Google Workspace subscriptions. To learn how to use this method, see
+     * [List Google Workspace
+     * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse> + listSubscriptions( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSubscriptionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates or renews a Google Workspace subscription. To learn how to use this
+     * method, see [Update or renew a Google Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSubscription( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSubscriptionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reactivates a suspended Google Workspace subscription.
+     * This method resets your subscription's `State` field to `ACTIVE`. Before
+     * you use this method, you must fix the error that suspended the
+     * subscription. To learn how to use this method, see [Reactivate a Google
+     * Workspace
+     * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + reactivateSubscription( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReactivateSubscriptionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SUBSCRIPTION = 0; + private static final int METHODID_DELETE_SUBSCRIPTION = 1; + private static final int METHODID_GET_SUBSCRIPTION = 2; + private static final int METHODID_LIST_SUBSCRIPTIONS = 3; + private static final int METHODID_UPDATE_SUBSCRIPTION = 4; + private static final int METHODID_REACTIVATE_SUBSCRIPTION = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SUBSCRIPTION: + serviceImpl.createSubscription( + (com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SUBSCRIPTION: + serviceImpl.deleteSubscription( + (com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SUBSCRIPTION: + serviceImpl.getSubscription( + (com.google.apps.events.subscriptions.v1.GetSubscriptionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SUBSCRIPTIONS: + serviceImpl.listSubscriptions( + (com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse>) + responseObserver); + break; + case METHODID_UPDATE_SUBSCRIPTION: + serviceImpl.updateSubscription( + (com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REACTIVATE_SUBSCRIPTION: + serviceImpl.reactivateSubscription( + (com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_SUBSCRIPTION))) + .addMethod( + getDeleteSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_SUBSCRIPTION))) + .addMethod( + getGetSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest, + com.google.apps.events.subscriptions.v1.Subscription>( + service, METHODID_GET_SUBSCRIPTION))) + .addMethod( + getListSubscriptionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest, + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse>( + service, METHODID_LIST_SUBSCRIPTIONS))) + .addMethod( + getUpdateSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_SUBSCRIPTION))) + .addMethod( + getReactivateSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest, + com.google.longrunning.Operation>(service, METHODID_REACTIVATE_SUBSCRIPTION))) + .build(); + } + + private abstract static class SubscriptionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SubscriptionsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SubscriptionsService"); + } + } + + private static final class SubscriptionsServiceFileDescriptorSupplier + extends SubscriptionsServiceBaseDescriptorSupplier { + SubscriptionsServiceFileDescriptorSupplier() {} + } + + private static final class SubscriptionsServiceMethodDescriptorSupplier + extends SubscriptionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SubscriptionsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SubscriptionsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SubscriptionsServiceFileDescriptorSupplier()) + .addMethod(getCreateSubscriptionMethod()) + .addMethod(getDeleteSubscriptionMethod()) + .addMethod(getGetSubscriptionMethod()) + .addMethod(getListSubscriptionsMethod()) + .addMethod(getUpdateSubscriptionMethod()) + .addMethod(getReactivateSubscriptionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-workspaceevents/owlbot.py b/java-workspaceevents/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-workspaceevents/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-workspaceevents/pom.xml b/java-workspaceevents/pom.xml new file mode 100644 index 000000000000..251edd9c5646 --- /dev/null +++ b/java-workspaceevents/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workspaceevents-parent + pom + 0.0.1-SNAPSHOT + Google Google Workspace Events API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.31.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-workspaceevents-parent + + + + + + com.google.cloud + google-cloud-workspaceevents + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workspaceevents-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workspaceevents-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-workspaceevents + grpc-google-cloud-workspaceevents-v1 + proto-google-cloud-workspaceevents-v1 + google-cloud-workspaceevents-bom + + + diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/clirr-ignored-differences.xml b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..321b7a927492 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/apps/events/subscriptions/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/apps/events/subscriptions/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/apps/events/subscriptions/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/pom.xml b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/pom.xml new file mode 100644 index 000000000000..518e62ab95d2 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-workspaceevents-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-workspaceevents-v1 + Proto library for google-cloud-workspaceevents + + com.google.cloud + google-cloud-workspaceevents-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionMetadata.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionMetadata.java new file mode 100644 index 000000000000..8614fc66aae5 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionMetadata.java @@ -0,0 +1,443 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * Metadata for CreateSubscription LRO.
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.CreateSubscriptionMetadata} + */ +public final class CreateSubscriptionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) + CreateSubscriptionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSubscriptionMetadata.newBuilder() to construct. + private CreateSubscriptionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSubscriptionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSubscriptionMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata other = + (com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata 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.apps.events.subscriptions.v1.CreateSubscriptionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata 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.apps.events.subscriptions.v1.CreateSubscriptionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata + 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.apps.events.subscriptions.v1.CreateSubscriptionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata 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.apps.events.subscriptions.v1.CreateSubscriptionMetadata 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; + } + /** + * + * + *
+   * Metadata for CreateSubscription LRO.
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.CreateSubscriptionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata build() { + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata buildPartial() { + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata result = + new com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) { + return mergeFrom( + (com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata other) { + if (other + == com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) + private static final com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata(); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSubscriptionMetadata 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.apps.events.subscriptions.v1.CreateSubscriptionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionMetadataOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionMetadataOrBuilder.java new file mode 100644 index 000000000000..1c0857ce5a2a --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionMetadataOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface CreateSubscriptionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.CreateSubscriptionMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionRequest.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionRequest.java new file mode 100644 index 000000000000..2202c55706bd --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionRequest.java @@ -0,0 +1,858 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The request message for
+ * [SubscriptionsService.CreateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.CreateSubscription].
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.CreateSubscriptionRequest} + */ +public final class CreateSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.CreateSubscriptionRequest) + CreateSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSubscriptionRequest.newBuilder() to construct. + private CreateSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSubscriptionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.Builder.class); + } + + private int bitField0_; + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private com.google.apps.events.subscriptions.v1.Subscription subscription_; + /** + * + * + *
+   * Required. The subscription resource to create.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the subscription field is set. + */ + @java.lang.Override + public boolean hasSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The subscription resource to create.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The subscription. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription getSubscription() { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } + /** + * + * + *
+   * Required. The subscription resource to create.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder getSubscriptionOrBuilder() { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set to `true`, validates and previews the request, but doesn't
+   * create the subscription.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSubscription()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSubscription()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + 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.apps.events.subscriptions.v1.CreateSubscriptionRequest)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest other = + (com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest) obj; + + if (hasSubscription() != other.hasSubscription()) return false; + if (hasSubscription()) { + if (!getSubscription().equals(other.getSubscription())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSubscription()) { + hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getSubscription().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest 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.apps.events.subscriptions.v1.CreateSubscriptionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest 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.apps.events.subscriptions.v1.CreateSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest + 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.apps.events.subscriptions.v1.CreateSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest 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.apps.events.subscriptions.v1.CreateSubscriptionRequest 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
+   * [SubscriptionsService.CreateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.CreateSubscription].
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.CreateSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.CreateSubscriptionRequest) + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSubscriptionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + subscription_ = null; + if (subscriptionBuilder_ != null) { + subscriptionBuilder_.dispose(); + subscriptionBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest build() { + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest buildPartial() { + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest result = + new com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.subscription_ = + subscriptionBuilder_ == null ? subscription_ : subscriptionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest) { + return mergeFrom((com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest other) { + if (other + == com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest.getDefaultInstance()) + return this; + if (other.hasSubscription()) { + mergeSubscription(other.getSubscription()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getSubscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.apps.events.subscriptions.v1.Subscription subscription_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder> + subscriptionBuilder_; + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the subscription field is set. + */ + public boolean hasSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The subscription. + */ + public com.google.apps.events.subscriptions.v1.Subscription getSubscription() { + if (subscriptionBuilder_ == null) { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } else { + return subscriptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSubscription(com.google.apps.events.subscriptions.v1.Subscription value) { + if (subscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subscription_ = value; + } else { + subscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSubscription( + com.google.apps.events.subscriptions.v1.Subscription.Builder builderForValue) { + if (subscriptionBuilder_ == null) { + subscription_ = builderForValue.build(); + } else { + subscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSubscription(com.google.apps.events.subscriptions.v1.Subscription value) { + if (subscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && subscription_ != null + && subscription_ + != com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance()) { + getSubscriptionBuilder().mergeFrom(value); + } else { + subscription_ = value; + } + } else { + subscriptionBuilder_.mergeFrom(value); + } + if (subscription_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSubscription() { + bitField0_ = (bitField0_ & ~0x00000001); + subscription_ = null; + if (subscriptionBuilder_ != null) { + subscriptionBuilder_.dispose(); + subscriptionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.apps.events.subscriptions.v1.Subscription.Builder getSubscriptionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSubscriptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder + getSubscriptionOrBuilder() { + if (subscriptionBuilder_ != null) { + return subscriptionBuilder_.getMessageOrBuilder(); + } else { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } + } + /** + * + * + *
+     * Required. The subscription resource to create.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder> + getSubscriptionFieldBuilder() { + if (subscriptionBuilder_ == null) { + subscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder>( + getSubscription(), getParentForChildren(), isClean()); + subscription_ = null; + } + return subscriptionBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * create the subscription.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * create the subscription.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * create the subscription.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.CreateSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.CreateSubscriptionRequest) + private static final com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest(); + } + + public static com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSubscriptionRequest 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.apps.events.subscriptions.v1.CreateSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionRequestOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..2be5893015c8 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/CreateSubscriptionRequestOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface CreateSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.CreateSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The subscription resource to create.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the subscription field is set. + */ + boolean hasSubscription(); + /** + * + * + *
+   * Required. The subscription resource to create.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The subscription. + */ + com.google.apps.events.subscriptions.v1.Subscription getSubscription(); + /** + * + * + *
+   * Required. The subscription resource to create.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder getSubscriptionOrBuilder(); + + /** + * + * + *
+   * Optional. If set to `true`, validates and previews the request, but doesn't
+   * create the subscription.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionMetadata.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionMetadata.java new file mode 100644 index 000000000000..e3c3dafaae4d --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionMetadata.java @@ -0,0 +1,443 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * Metadata for DeleteSubscription LRO.
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata} + */ +public final class DeleteSubscriptionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) + DeleteSubscriptionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSubscriptionMetadata.newBuilder() to construct. + private DeleteSubscriptionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSubscriptionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSubscriptionMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata other = + (com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata 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.apps.events.subscriptions.v1.DeleteSubscriptionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata 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.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + 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.apps.events.subscriptions.v1.DeleteSubscriptionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata 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.apps.events.subscriptions.v1.DeleteSubscriptionMetadata 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; + } + /** + * + * + *
+   * Metadata for DeleteSubscription LRO.
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata build() { + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata buildPartial() { + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata result = + new com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) { + return mergeFrom( + (com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata other) { + if (other + == com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) + private static final com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata(); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSubscriptionMetadata 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.apps.events.subscriptions.v1.DeleteSubscriptionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionMetadataOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionMetadataOrBuilder.java new file mode 100644 index 000000000000..42e45a1a67fd --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionMetadataOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface DeleteSubscriptionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionRequest.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionRequest.java new file mode 100644 index 000000000000..83554e3b2a10 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionRequest.java @@ -0,0 +1,1062 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The request message for
+ * [SubscriptionsService.DeleteSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.DeleteSubscription].
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.DeleteSubscriptionRequest} + */ +public final class DeleteSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) + DeleteSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSubscriptionRequest.newBuilder() to construct. + private DeleteSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSubscriptionRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Resource name of the subscription to delete.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * 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. Resource name of the subscription to delete.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set to `true`, validates and previews the request, but doesn't
+   * delete the subscription.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to `true` and the subscription isn't found, the request
+   * succeeds but doesn't delete the subscription.
+   * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. Etag of the subscription.
+   *
+   * If present, it must match with the server's etag. Otherwise, request
+   * fails with the status `ABORTED`.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Etag of the subscription.
+   *
+   * If present, it must match with the server's etag. Otherwise, request
+   * fails with the status `ABORTED`.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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 (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + 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 (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + 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.apps.events.subscriptions.v1.DeleteSubscriptionRequest)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest other = + (com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for
+   * [SubscriptionsService.DeleteSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.DeleteSubscription].
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.DeleteSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + validateOnly_ = false; + allowMissing_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest build() { + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest buildPartial() { + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest result = + new com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allowMissing_ = allowMissing_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + } + + @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.apps.events.subscriptions.v1.DeleteSubscriptionRequest) { + return mergeFrom((com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest other) { + if (other + == com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the subscription to delete.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * 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. Resource name of the subscription to delete.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * 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. Resource name of the subscription to delete.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the subscription to delete.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the subscription to delete.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * delete the subscription.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * delete the subscription.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * delete the subscription.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to `true` and the subscription isn't found, the request
+     * succeeds but doesn't delete the subscription.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to `true` and the subscription isn't found, the request
+     * succeeds but doesn't delete the subscription.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to `true` and the subscription isn't found, the request
+     * succeeds but doesn't delete the subscription.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000004); + allowMissing_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. Etag of the subscription.
+     *
+     * If present, it must match with the server's etag. Otherwise, request
+     * fails with the status `ABORTED`.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Etag of the subscription.
+     *
+     * If present, it must match with the server's etag. Otherwise, request
+     * fails with the status `ABORTED`.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Etag of the subscription.
+     *
+     * If present, it must match with the server's etag. Otherwise, request
+     * fails with the status `ABORTED`.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Etag of the subscription.
+     *
+     * If present, it must match with the server's etag. Otherwise, request
+     * fails with the status `ABORTED`.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Etag of the subscription.
+     *
+     * If present, it must match with the server's etag. Otherwise, request
+     * fails with the status `ABORTED`.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) + private static final com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest(); + } + + public static com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionRequestOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..71caab8e8e8b --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/DeleteSubscriptionRequestOrBuilder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface DeleteSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.DeleteSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the subscription to delete.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the subscription to delete.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. If set to `true`, validates and previews the request, but doesn't
+   * delete the subscription.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set to `true` and the subscription isn't found, the request
+   * succeeds but doesn't delete the subscription.
+   * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); + + /** + * + * + *
+   * Optional. Etag of the subscription.
+   *
+   * If present, it must match with the server's etag. Otherwise, request
+   * fails with the status `ABORTED`.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. Etag of the subscription.
+   *
+   * If present, it must match with the server's etag. Otherwise, request
+   * fails with the status `ABORTED`.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/GetSubscriptionRequest.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/GetSubscriptionRequest.java new file mode 100644 index 000000000000..fefa70a60b16 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/GetSubscriptionRequest.java @@ -0,0 +1,662 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The request message for
+ * [SubscriptionsService.GetSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.GetSubscription].
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.GetSubscriptionRequest} + */ +public final class GetSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.GetSubscriptionRequest) + GetSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSubscriptionRequest.newBuilder() to construct. + private GetSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSubscriptionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * 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. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * 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.apps.events.subscriptions.v1.GetSubscriptionRequest)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest other = + (com.google.apps.events.subscriptions.v1.GetSubscriptionRequest) 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.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for
+   * [SubscriptionsService.GetSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.GetSubscription].
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.GetSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.GetSubscriptionRequest) + com.google.apps.events.subscriptions.v1.GetSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.Builder.class); + } + + // Construct using com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.GetSubscriptionRequest + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.GetSubscriptionRequest build() { + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.GetSubscriptionRequest buildPartial() { + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest result = + new com.google.apps.events.subscriptions.v1.GetSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.GetSubscriptionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.GetSubscriptionRequest) { + return mergeFrom((com.google.apps.events.subscriptions.v1.GetSubscriptionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.events.subscriptions.v1.GetSubscriptionRequest other) { + if (other + == com.google.apps.events.subscriptions.v1.GetSubscriptionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * 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. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * 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. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.GetSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.GetSubscriptionRequest) + private static final com.google.apps.events.subscriptions.v1.GetSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.GetSubscriptionRequest(); + } + + public static com.google.apps.events.subscriptions.v1.GetSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.GetSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/GetSubscriptionRequestOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/GetSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..0f0ce0587cbc --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/GetSubscriptionRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface GetSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.GetSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * 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-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsRequest.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsRequest.java new file mode 100644 index 000000000000..fbcff6efc245 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsRequest.java @@ -0,0 +1,1151 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The request message for
+ * [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ListSubscriptionsRequest} + */ +public final class ListSubscriptionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.ListSubscriptionsRequest) + ListSubscriptionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSubscriptionsRequest.newBuilder() to construct. + private ListSubscriptionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSubscriptionsRequest() { + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSubscriptionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.class, + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of subscriptions to return. The service might
+   * return fewer than this value.
+   *
+   * If unspecified or set to `0`, up to 50 subscriptions are returned.
+   *
+   * The maximum value is 100. If you specify a value more than 100, the system
+   * only returns 100 subscriptions.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous list subscriptions call.
+   * Provide this parameter to retrieve the subsequent page.
+   *
+   * When paginating, the filter value should match the call that provided the
+   * page token. Passing a different value might lead to unexpected results.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A page token, received from a previous list subscriptions call.
+   * Provide this parameter to retrieve the subsequent page.
+   *
+   * When paginating, the filter value should match the call that provided the
+   * page token. Passing a different value might lead to unexpected results.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Required. A query filter.
+   *
+   * You can filter subscriptions by event type (`event_types`)
+   * and target resource (`target_resource`).
+   *
+   * You must specify at least one event type in your query. To filter for
+   * multiple event types, use the `OR` operator.
+   *
+   * To filter by both event type and target resource, use the `AND` operator
+   * and specify the full resource name, such as
+   * `//chat.googleapis.com/spaces/{space}`.
+   *
+   * For example, the following queries are valid:
+   *
+   * ```
+   * event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created"
+   *
+   * event_types:"google.workspace.chat.message.v1.created" AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   *
+   * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created" ) AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   * ```
+   *
+   * The server rejects invalid queries with an `INVALID_ARGUMENT`
+   * error.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. A query filter.
+   *
+   * You can filter subscriptions by event type (`event_types`)
+   * and target resource (`target_resource`).
+   *
+   * You must specify at least one event type in your query. To filter for
+   * multiple event types, use the `OR` operator.
+   *
+   * To filter by both event type and target resource, use the `AND` operator
+   * and specify the full resource name, such as
+   * `//chat.googleapis.com/spaces/{space}`.
+   *
+   * For example, the following queries are valid:
+   *
+   * ```
+   * event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created"
+   *
+   * event_types:"google.workspace.chat.message.v1.created" AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   *
+   * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created" ) AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   * ```
+   *
+   * The server rejects invalid queries with an `INVALID_ARGUMENT`
+   * error.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 + 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 (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + 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.apps.events.subscriptions.v1.ListSubscriptionsRequest)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest other = + (com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest) obj; + + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for
+   * [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ListSubscriptionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.ListSubscriptionsRequest) + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.class, + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.Builder.class); + } + + // Construct using com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest build() { + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest buildPartial() { + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest result = + new com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.filter_ = filter_; + } + } + + @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.apps.events.subscriptions.v1.ListSubscriptionsRequest) { + return mergeFrom((com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest other) { + if (other + == com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest.getDefaultInstance()) + return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of subscriptions to return. The service might
+     * return fewer than this value.
+     *
+     * If unspecified or set to `0`, up to 50 subscriptions are returned.
+     *
+     * The maximum value is 100. If you specify a value more than 100, the system
+     * only returns 100 subscriptions.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of subscriptions to return. The service might
+     * return fewer than this value.
+     *
+     * If unspecified or set to `0`, up to 50 subscriptions are returned.
+     *
+     * The maximum value is 100. If you specify a value more than 100, the system
+     * only returns 100 subscriptions.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of subscriptions to return. The service might
+     * return fewer than this value.
+     *
+     * If unspecified or set to `0`, up to 50 subscriptions are returned.
+     *
+     * The maximum value is 100. If you specify a value more than 100, the system
+     * only returns 100 subscriptions.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous list subscriptions call.
+     * Provide this parameter to retrieve the subsequent page.
+     *
+     * When paginating, the filter value should match the call that provided the
+     * page token. Passing a different value might lead to unexpected results.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A page token, received from a previous list subscriptions call.
+     * Provide this parameter to retrieve the subsequent page.
+     *
+     * When paginating, the filter value should match the call that provided the
+     * page token. Passing a different value might lead to unexpected results.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A page token, received from a previous list subscriptions call.
+     * Provide this parameter to retrieve the subsequent page.
+     *
+     * When paginating, the filter value should match the call that provided the
+     * page token. Passing a different value might lead to unexpected results.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous list subscriptions call.
+     * Provide this parameter to retrieve the subsequent page.
+     *
+     * When paginating, the filter value should match the call that provided the
+     * page token. Passing a different value might lead to unexpected results.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous list subscriptions call.
+     * Provide this parameter to retrieve the subsequent page.
+     *
+     * When paginating, the filter value should match the call that provided the
+     * page token. Passing a different value might lead to unexpected results.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Required. A query filter.
+     *
+     * You can filter subscriptions by event type (`event_types`)
+     * and target resource (`target_resource`).
+     *
+     * You must specify at least one event type in your query. To filter for
+     * multiple event types, use the `OR` operator.
+     *
+     * To filter by both event type and target resource, use the `AND` operator
+     * and specify the full resource name, such as
+     * `//chat.googleapis.com/spaces/{space}`.
+     *
+     * For example, the following queries are valid:
+     *
+     * ```
+     * event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created"
+     *
+     * event_types:"google.workspace.chat.message.v1.created" AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     *
+     * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created" ) AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     * ```
+     *
+     * The server rejects invalid queries with an `INVALID_ARGUMENT`
+     * error.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. A query filter.
+     *
+     * You can filter subscriptions by event type (`event_types`)
+     * and target resource (`target_resource`).
+     *
+     * You must specify at least one event type in your query. To filter for
+     * multiple event types, use the `OR` operator.
+     *
+     * To filter by both event type and target resource, use the `AND` operator
+     * and specify the full resource name, such as
+     * `//chat.googleapis.com/spaces/{space}`.
+     *
+     * For example, the following queries are valid:
+     *
+     * ```
+     * event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created"
+     *
+     * event_types:"google.workspace.chat.message.v1.created" AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     *
+     * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created" ) AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     * ```
+     *
+     * The server rejects invalid queries with an `INVALID_ARGUMENT`
+     * error.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. A query filter.
+     *
+     * You can filter subscriptions by event type (`event_types`)
+     * and target resource (`target_resource`).
+     *
+     * You must specify at least one event type in your query. To filter for
+     * multiple event types, use the `OR` operator.
+     *
+     * To filter by both event type and target resource, use the `AND` operator
+     * and specify the full resource name, such as
+     * `//chat.googleapis.com/spaces/{space}`.
+     *
+     * For example, the following queries are valid:
+     *
+     * ```
+     * event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created"
+     *
+     * event_types:"google.workspace.chat.message.v1.created" AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     *
+     * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created" ) AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     * ```
+     *
+     * The server rejects invalid queries with an `INVALID_ARGUMENT`
+     * error.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A query filter.
+     *
+     * You can filter subscriptions by event type (`event_types`)
+     * and target resource (`target_resource`).
+     *
+     * You must specify at least one event type in your query. To filter for
+     * multiple event types, use the `OR` operator.
+     *
+     * To filter by both event type and target resource, use the `AND` operator
+     * and specify the full resource name, such as
+     * `//chat.googleapis.com/spaces/{space}`.
+     *
+     * For example, the following queries are valid:
+     *
+     * ```
+     * event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created"
+     *
+     * event_types:"google.workspace.chat.message.v1.created" AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     *
+     * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created" ) AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     * ```
+     *
+     * The server rejects invalid queries with an `INVALID_ARGUMENT`
+     * error.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A query filter.
+     *
+     * You can filter subscriptions by event type (`event_types`)
+     * and target resource (`target_resource`).
+     *
+     * You must specify at least one event type in your query. To filter for
+     * multiple event types, use the `OR` operator.
+     *
+     * To filter by both event type and target resource, use the `AND` operator
+     * and specify the full resource name, such as
+     * `//chat.googleapis.com/spaces/{space}`.
+     *
+     * For example, the following queries are valid:
+     *
+     * ```
+     * event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created"
+     *
+     * event_types:"google.workspace.chat.message.v1.created" AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     *
+     * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+     *   event_types:"google.workspace.chat.message.v1.created" ) AND
+     *   target_resource="//chat.googleapis.com/spaces/{space}"
+     * ```
+     *
+     * The server rejects invalid queries with an `INVALID_ARGUMENT`
+     * error.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.ListSubscriptionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.ListSubscriptionsRequest) + private static final com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest(); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSubscriptionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsRequestOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsRequestOrBuilder.java new file mode 100644 index 000000000000..9601a5d7d4a0 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsRequestOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface ListSubscriptionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.ListSubscriptionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The maximum number of subscriptions to return. The service might
+   * return fewer than this value.
+   *
+   * If unspecified or set to `0`, up to 50 subscriptions are returned.
+   *
+   * The maximum value is 100. If you specify a value more than 100, the system
+   * only returns 100 subscriptions.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous list subscriptions call.
+   * Provide this parameter to retrieve the subsequent page.
+   *
+   * When paginating, the filter value should match the call that provided the
+   * page token. Passing a different value might lead to unexpected results.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous list subscriptions call.
+   * Provide this parameter to retrieve the subsequent page.
+   *
+   * When paginating, the filter value should match the call that provided the
+   * page token. Passing a different value might lead to unexpected results.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Required. A query filter.
+   *
+   * You can filter subscriptions by event type (`event_types`)
+   * and target resource (`target_resource`).
+   *
+   * You must specify at least one event type in your query. To filter for
+   * multiple event types, use the `OR` operator.
+   *
+   * To filter by both event type and target resource, use the `AND` operator
+   * and specify the full resource name, such as
+   * `//chat.googleapis.com/spaces/{space}`.
+   *
+   * For example, the following queries are valid:
+   *
+   * ```
+   * event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created"
+   *
+   * event_types:"google.workspace.chat.message.v1.created" AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   *
+   * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created" ) AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   * ```
+   *
+   * The server rejects invalid queries with an `INVALID_ARGUMENT`
+   * error.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Required. A query filter.
+   *
+   * You can filter subscriptions by event type (`event_types`)
+   * and target resource (`target_resource`).
+   *
+   * You must specify at least one event type in your query. To filter for
+   * multiple event types, use the `OR` operator.
+   *
+   * To filter by both event type and target resource, use the `AND` operator
+   * and specify the full resource name, such as
+   * `//chat.googleapis.com/spaces/{space}`.
+   *
+   * For example, the following queries are valid:
+   *
+   * ```
+   * event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created"
+   *
+   * event_types:"google.workspace.chat.message.v1.created" AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   *
+   * ( event_types:"google.workspace.chat.membership.v1.updated" OR
+   *   event_types:"google.workspace.chat.message.v1.created" ) AND
+   *   target_resource="//chat.googleapis.com/spaces/{space}"
+   * ```
+   *
+   * The server rejects invalid queries with an `INVALID_ARGUMENT`
+   * error.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsResponse.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsResponse.java new file mode 100644 index 000000000000..978affad459a --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsResponse.java @@ -0,0 +1,1153 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The response message for
+ * [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ListSubscriptionsResponse} + */ +public final class ListSubscriptionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.ListSubscriptionsResponse) + ListSubscriptionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSubscriptionsResponse.newBuilder() to construct. + private ListSubscriptionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSubscriptionsResponse() { + subscriptions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSubscriptionsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.class, + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.Builder.class); + } + + public static final int SUBSCRIPTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List subscriptions_; + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + @java.lang.Override + public java.util.List + getSubscriptionsList() { + return subscriptions_; + } + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + @java.lang.Override + public java.util.List + getSubscriptionsOrBuilderList() { + return subscriptions_; + } + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + @java.lang.Override + public int getSubscriptionsCount() { + return subscriptions_.size(); + } + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription getSubscriptions(int index) { + return subscriptions_.get(index); + } + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder( + int index) { + return subscriptions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < subscriptions_.size(); i++) { + output.writeMessage(1, subscriptions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < subscriptions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, subscriptions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse other = + (com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse) obj; + + if (!getSubscriptionsList().equals(other.getSubscriptionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSubscriptionsCount() > 0) { + hash = (37 * hash) + SUBSCRIPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getSubscriptionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response message for
+   * [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ListSubscriptionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.ListSubscriptionsResponse) + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.class, + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (subscriptionsBuilder_ == null) { + subscriptions_ = java.util.Collections.emptyList(); + } else { + subscriptions_ = null; + subscriptionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse build() { + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse buildPartial() { + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse result = + new com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse result) { + if (subscriptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + subscriptions_ = java.util.Collections.unmodifiableList(subscriptions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.subscriptions_ = subscriptions_; + } else { + result.subscriptions_ = subscriptionsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse) { + return mergeFrom((com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse other) { + if (other + == com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse.getDefaultInstance()) + return this; + if (subscriptionsBuilder_ == null) { + if (!other.subscriptions_.isEmpty()) { + if (subscriptions_.isEmpty()) { + subscriptions_ = other.subscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSubscriptionsIsMutable(); + subscriptions_.addAll(other.subscriptions_); + } + onChanged(); + } + } else { + if (!other.subscriptions_.isEmpty()) { + if (subscriptionsBuilder_.isEmpty()) { + subscriptionsBuilder_.dispose(); + subscriptionsBuilder_ = null; + subscriptions_ = other.subscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + subscriptionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSubscriptionsFieldBuilder() + : null; + } else { + subscriptionsBuilder_.addAllMessages(other.subscriptions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.apps.events.subscriptions.v1.Subscription m = + input.readMessage( + com.google.apps.events.subscriptions.v1.Subscription.parser(), + extensionRegistry); + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.add(m); + } else { + subscriptionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List subscriptions_ = + java.util.Collections.emptyList(); + + private void ensureSubscriptionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + subscriptions_ = + new java.util.ArrayList( + subscriptions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder> + subscriptionsBuilder_; + + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public java.util.List + getSubscriptionsList() { + if (subscriptionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(subscriptions_); + } else { + return subscriptionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public int getSubscriptionsCount() { + if (subscriptionsBuilder_ == null) { + return subscriptions_.size(); + } else { + return subscriptionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public com.google.apps.events.subscriptions.v1.Subscription getSubscriptions(int index) { + if (subscriptionsBuilder_ == null) { + return subscriptions_.get(index); + } else { + return subscriptionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder setSubscriptions( + int index, com.google.apps.events.subscriptions.v1.Subscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, value); + onChanged(); + } else { + subscriptionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder setSubscriptions( + int index, com.google.apps.events.subscriptions.v1.Subscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder addSubscriptions(com.google.apps.events.subscriptions.v1.Subscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.add(value); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder addSubscriptions( + int index, com.google.apps.events.subscriptions.v1.Subscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.add(index, value); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder addSubscriptions( + com.google.apps.events.subscriptions.v1.Subscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.add(builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder addSubscriptions( + int index, com.google.apps.events.subscriptions.v1.Subscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.add(index, builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder addAllSubscriptions( + java.lang.Iterable values) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, subscriptions_); + onChanged(); + } else { + subscriptionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder clearSubscriptions() { + if (subscriptionsBuilder_ == null) { + subscriptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + subscriptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public Builder removeSubscriptions(int index) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.remove(index); + onChanged(); + } else { + subscriptionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public com.google.apps.events.subscriptions.v1.Subscription.Builder getSubscriptionsBuilder( + int index) { + return getSubscriptionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder( + int index) { + if (subscriptionsBuilder_ == null) { + return subscriptions_.get(index); + } else { + return subscriptionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public java.util.List + getSubscriptionsOrBuilderList() { + if (subscriptionsBuilder_ != null) { + return subscriptionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subscriptions_); + } + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public com.google.apps.events.subscriptions.v1.Subscription.Builder addSubscriptionsBuilder() { + return getSubscriptionsFieldBuilder() + .addBuilder(com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance()); + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public com.google.apps.events.subscriptions.v1.Subscription.Builder addSubscriptionsBuilder( + int index) { + return getSubscriptionsFieldBuilder() + .addBuilder( + index, com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance()); + } + /** + * + * + *
+     * List of subscriptions.
+     * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + public java.util.List + getSubscriptionsBuilderList() { + return getSubscriptionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder> + getSubscriptionsFieldBuilder() { + if (subscriptionsBuilder_ == null) { + subscriptionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder>( + subscriptions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + subscriptions_ = null; + } + return subscriptionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.ListSubscriptionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.ListSubscriptionsResponse) + private static final com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse(); + } + + public static com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSubscriptionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsResponseOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsResponseOrBuilder.java new file mode 100644 index 000000000000..748e052348ed --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ListSubscriptionsResponseOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface ListSubscriptionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.ListSubscriptionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + java.util.List getSubscriptionsList(); + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + com.google.apps.events.subscriptions.v1.Subscription getSubscriptions(int index); + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + int getSubscriptionsCount(); + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + java.util.List + getSubscriptionsOrBuilderList(); + /** + * + * + *
+   * List of subscriptions.
+   * 
+ * + * repeated .google.apps.events.subscriptions.v1.Subscription subscriptions = 1; + */ + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder( + int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/NotificationEndpoint.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/NotificationEndpoint.java new file mode 100644 index 000000000000..c1279cd97436 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/NotificationEndpoint.java @@ -0,0 +1,879 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscription_resource.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The endpoint where the subscription delivers events.
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.NotificationEndpoint} + */ +public final class NotificationEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.NotificationEndpoint) + NotificationEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use NotificationEndpoint.newBuilder() to construct. + private NotificationEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NotificationEndpoint() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NotificationEndpoint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.NotificationEndpoint.class, + com.google.apps.events.subscriptions.v1.NotificationEndpoint.Builder.class); + } + + private int endpointCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object endpoint_; + + public enum EndpointCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PUBSUB_TOPIC(1), + ENDPOINT_NOT_SET(0); + private final int value; + + private EndpointCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EndpointCase valueOf(int value) { + return forNumber(value); + } + + public static EndpointCase forNumber(int value) { + switch (value) { + case 1: + return PUBSUB_TOPIC; + case 0: + return ENDPOINT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndpointCase getEndpointCase() { + return EndpointCase.forNumber(endpointCase_); + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 1; + /** + * + * + *
+   * Immutable. The Cloud Pub/Sub topic that receives events for the
+   * subscription.
+   *
+   * Format: `projects/{project}/topics/{topic}`
+   *
+   *
+   * You must create the topic in the same Google Cloud project where
+   * you create this subscription.
+   *
+   * When the topic receives events, the events are encoded as Cloud Pub/Sub
+   * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+   * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+   * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the pubsubTopic field is set. + */ + public boolean hasPubsubTopic() { + return endpointCase_ == 1; + } + /** + * + * + *
+   * Immutable. The Cloud Pub/Sub topic that receives events for the
+   * subscription.
+   *
+   * Format: `projects/{project}/topics/{topic}`
+   *
+   *
+   * You must create the topic in the same Google Cloud project where
+   * you create this subscription.
+   *
+   * When the topic receives events, the events are encoded as Cloud Pub/Sub
+   * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+   * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+   * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + public java.lang.String getPubsubTopic() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + 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 (endpointCase_ == 1) { + endpoint_ = s; + } + return s; + } + } + /** + * + * + *
+   * Immutable. The Cloud Pub/Sub topic that receives events for the
+   * subscription.
+   *
+   * Format: `projects/{project}/topics/{topic}`
+   *
+   *
+   * You must create the topic in the same Google Cloud project where
+   * you create this subscription.
+   *
+   * When the topic receives events, the events are encoded as Cloud Pub/Sub
+   * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+   * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+   * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (endpointCase_ == 1) { + endpoint_ = 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 (endpointCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endpointCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + 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.apps.events.subscriptions.v1.NotificationEndpoint)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.NotificationEndpoint other = + (com.google.apps.events.subscriptions.v1.NotificationEndpoint) obj; + + if (!getEndpointCase().equals(other.getEndpointCase())) return false; + switch (endpointCase_) { + case 1: + if (!getPubsubTopic().equals(other.getPubsubTopic())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (endpointCase_) { + case 1: + hash = (37 * hash) + PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getPubsubTopic().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint 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.apps.events.subscriptions.v1.NotificationEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint 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.apps.events.subscriptions.v1.NotificationEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint 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.apps.events.subscriptions.v1.NotificationEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint 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.apps.events.subscriptions.v1.NotificationEndpoint 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 endpoint where the subscription delivers events.
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.NotificationEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.NotificationEndpoint) + com.google.apps.events.subscriptions.v1.NotificationEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.NotificationEndpoint.class, + com.google.apps.events.subscriptions.v1.NotificationEndpoint.Builder.class); + } + + // Construct using com.google.apps.events.subscriptions.v1.NotificationEndpoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpointCase_ = 0; + endpoint_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.NotificationEndpoint + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.NotificationEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.NotificationEndpoint build() { + com.google.apps.events.subscriptions.v1.NotificationEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.NotificationEndpoint buildPartial() { + com.google.apps.events.subscriptions.v1.NotificationEndpoint result = + new com.google.apps.events.subscriptions.v1.NotificationEndpoint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.NotificationEndpoint result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.apps.events.subscriptions.v1.NotificationEndpoint result) { + result.endpointCase_ = endpointCase_; + result.endpoint_ = this.endpoint_; + } + + @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.apps.events.subscriptions.v1.NotificationEndpoint) { + return mergeFrom((com.google.apps.events.subscriptions.v1.NotificationEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.events.subscriptions.v1.NotificationEndpoint other) { + if (other + == com.google.apps.events.subscriptions.v1.NotificationEndpoint.getDefaultInstance()) + return this; + switch (other.getEndpointCase()) { + case PUBSUB_TOPIC: + { + endpointCase_ = 1; + endpoint_ = other.endpoint_; + onChanged(); + break; + } + case ENDPOINT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + endpointCase_ = 1; + endpoint_ = s; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int endpointCase_ = 0; + private java.lang.Object endpoint_; + + public EndpointCase getEndpointCase() { + return EndpointCase.forNumber(endpointCase_); + } + + public Builder clearEndpoint() { + endpointCase_ = 0; + endpoint_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Immutable. The Cloud Pub/Sub topic that receives events for the
+     * subscription.
+     *
+     * Format: `projects/{project}/topics/{topic}`
+     *
+     *
+     * You must create the topic in the same Google Cloud project where
+     * you create this subscription.
+     *
+     * When the topic receives events, the events are encoded as Cloud Pub/Sub
+     * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+     * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+     * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the pubsubTopic field is set. + */ + @java.lang.Override + public boolean hasPubsubTopic() { + return endpointCase_ == 1; + } + /** + * + * + *
+     * Immutable. The Cloud Pub/Sub topic that receives events for the
+     * subscription.
+     *
+     * Format: `projects/{project}/topics/{topic}`
+     *
+     *
+     * You must create the topic in the same Google Cloud project where
+     * you create this subscription.
+     *
+     * When the topic receives events, the events are encoded as Cloud Pub/Sub
+     * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+     * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+     * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + @java.lang.Override + public java.lang.String getPubsubTopic() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (endpointCase_ == 1) { + endpoint_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The Cloud Pub/Sub topic that receives events for the
+     * subscription.
+     *
+     * Format: `projects/{project}/topics/{topic}`
+     *
+     *
+     * You must create the topic in the same Google Cloud project where
+     * you create this subscription.
+     *
+     * When the topic receives events, the events are encoded as Cloud Pub/Sub
+     * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+     * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+     * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (endpointCase_ == 1) { + endpoint_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The Cloud Pub/Sub topic that receives events for the
+     * subscription.
+     *
+     * Format: `projects/{project}/topics/{topic}`
+     *
+     *
+     * You must create the topic in the same Google Cloud project where
+     * you create this subscription.
+     *
+     * When the topic receives events, the events are encoded as Cloud Pub/Sub
+     * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+     * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+     * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpointCase_ = 1; + endpoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The Cloud Pub/Sub topic that receives events for the
+     * subscription.
+     *
+     * Format: `projects/{project}/topics/{topic}`
+     *
+     *
+     * You must create the topic in the same Google Cloud project where
+     * you create this subscription.
+     *
+     * When the topic receives events, the events are encoded as Cloud Pub/Sub
+     * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+     * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+     * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearPubsubTopic() { + if (endpointCase_ == 1) { + endpointCase_ = 0; + endpoint_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Immutable. The Cloud Pub/Sub topic that receives events for the
+     * subscription.
+     *
+     * Format: `projects/{project}/topics/{topic}`
+     *
+     *
+     * You must create the topic in the same Google Cloud project where
+     * you create this subscription.
+     *
+     * When the topic receives events, the events are encoded as Cloud Pub/Sub
+     * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+     * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+     * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpointCase_ = 1; + endpoint_ = 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.apps.events.subscriptions.v1.NotificationEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.NotificationEndpoint) + private static final com.google.apps.events.subscriptions.v1.NotificationEndpoint + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.NotificationEndpoint(); + } + + public static com.google.apps.events.subscriptions.v1.NotificationEndpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NotificationEndpoint 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.apps.events.subscriptions.v1.NotificationEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/NotificationEndpointOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/NotificationEndpointOrBuilder.java new file mode 100644 index 000000000000..4ea0d7ce7b0f --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/NotificationEndpointOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscription_resource.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface NotificationEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.NotificationEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The Cloud Pub/Sub topic that receives events for the
+   * subscription.
+   *
+   * Format: `projects/{project}/topics/{topic}`
+   *
+   *
+   * You must create the topic in the same Google Cloud project where
+   * you create this subscription.
+   *
+   * When the topic receives events, the events are encoded as Cloud Pub/Sub
+   * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+   * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+   * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the pubsubTopic field is set. + */ + boolean hasPubsubTopic(); + /** + * + * + *
+   * Immutable. The Cloud Pub/Sub topic that receives events for the
+   * subscription.
+   *
+   * Format: `projects/{project}/topics/{topic}`
+   *
+   *
+   * You must create the topic in the same Google Cloud project where
+   * you create this subscription.
+   *
+   * When the topic receives events, the events are encoded as Cloud Pub/Sub
+   * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+   * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+   * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + java.lang.String getPubsubTopic(); + /** + * + * + *
+   * Immutable. The Cloud Pub/Sub topic that receives events for the
+   * subscription.
+   *
+   * Format: `projects/{project}/topics/{topic}`
+   *
+   *
+   * You must create the topic in the same Google Cloud project where
+   * you create this subscription.
+   *
+   * When the topic receives events, the events are encoded as Cloud Pub/Sub
+   * messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
+   * CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
+   * 
+ * + * + * string pubsub_topic = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + com.google.protobuf.ByteString getPubsubTopicBytes(); + + com.google.apps.events.subscriptions.v1.NotificationEndpoint.EndpointCase getEndpointCase(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/PayloadOptions.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/PayloadOptions.java new file mode 100644 index 000000000000..a9b0097e7eb3 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/PayloadOptions.java @@ -0,0 +1,925 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscription_resource.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * Options about what data to include in the event payload. Only supported for
+ * Google Chat events.
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.PayloadOptions} + */ +public final class PayloadOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.PayloadOptions) + PayloadOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use PayloadOptions.newBuilder() to construct. + private PayloadOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PayloadOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PayloadOptions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_PayloadOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_PayloadOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.PayloadOptions.class, + com.google.apps.events.subscriptions.v1.PayloadOptions.Builder.class); + } + + private int bitField0_; + public static final int INCLUDE_RESOURCE_FIELD_NUMBER = 1; + private boolean includeResource_ = false; + /** + * + * + *
+   * Optional. Whether the event payload includes data about the resource that
+   * changed. For example, for an event where a Google Chat message was created,
+   * whether the payload contains data about the
+   * [`Message`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages)
+   * resource. If false, the event payload only includes the name of the changed
+   * resource.
+   * 
+ * + * bool include_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The includeResource. + */ + @java.lang.Override + public boolean getIncludeResource() { + return includeResource_; + } + + public static final int FIELD_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask fieldMask_; + /** + * + * + *
+   * Optional. If `include_resource` is set to `true`, the list of fields to
+   * include in the event payload. Separate fields with a comma. For example, to
+   * include a Google Chat message's sender and create time, enter
+   * `message.sender,message.createTime`. If omitted, the payload includes all
+   * fields for the resource.
+   *
+   * If you specify a field that doesn't exist for the resource, the system
+   * ignores the field.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + @java.lang.Override + public boolean hasFieldMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. If `include_resource` is set to `true`, the list of fields to
+   * include in the event payload. Separate fields with a comma. For example, to
+   * include a Google Chat message's sender and create time, enter
+   * `message.sender,message.createTime`. If omitted, the payload includes all
+   * fields for the resource.
+   *
+   * If you specify a field that doesn't exist for the resource, the system
+   * ignores the field.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getFieldMask() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + /** + * + * + *
+   * Optional. If `include_resource` is set to `true`, the list of fields to
+   * include in the event payload. Separate fields with a comma. For example, to
+   * include a Google Chat message's sender and create time, enter
+   * `message.sender,message.createTime`. If omitted, the payload includes all
+   * fields for the resource.
+   *
+   * If you specify a field that doesn't exist for the resource, the system
+   * ignores the field.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + + 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 (includeResource_ != false) { + output.writeBool(1, includeResource_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFieldMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (includeResource_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, includeResource_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFieldMask()); + } + 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.apps.events.subscriptions.v1.PayloadOptions)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.PayloadOptions other = + (com.google.apps.events.subscriptions.v1.PayloadOptions) obj; + + if (getIncludeResource() != other.getIncludeResource()) return false; + if (hasFieldMask() != other.hasFieldMask()) return false; + if (hasFieldMask()) { + if (!getFieldMask().equals(other.getFieldMask())) 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) + INCLUDE_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeResource()); + if (hasFieldMask()) { + hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getFieldMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions 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.apps.events.subscriptions.v1.PayloadOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions 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.apps.events.subscriptions.v1.PayloadOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions 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.apps.events.subscriptions.v1.PayloadOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions 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.apps.events.subscriptions.v1.PayloadOptions 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; + } + /** + * + * + *
+   * Options about what data to include in the event payload. Only supported for
+   * Google Chat events.
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.PayloadOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.PayloadOptions) + com.google.apps.events.subscriptions.v1.PayloadOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_PayloadOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_PayloadOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.PayloadOptions.class, + com.google.apps.events.subscriptions.v1.PayloadOptions.Builder.class); + } + + // Construct using com.google.apps.events.subscriptions.v1.PayloadOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFieldMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + includeResource_ = false; + fieldMask_ = null; + if (fieldMaskBuilder_ != null) { + fieldMaskBuilder_.dispose(); + fieldMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_PayloadOptions_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.PayloadOptions getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.PayloadOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.PayloadOptions build() { + com.google.apps.events.subscriptions.v1.PayloadOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.PayloadOptions buildPartial() { + com.google.apps.events.subscriptions.v1.PayloadOptions result = + new com.google.apps.events.subscriptions.v1.PayloadOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.events.subscriptions.v1.PayloadOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.includeResource_ = includeResource_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fieldMask_ = fieldMaskBuilder_ == null ? fieldMask_ : fieldMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.PayloadOptions) { + return mergeFrom((com.google.apps.events.subscriptions.v1.PayloadOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.events.subscriptions.v1.PayloadOptions other) { + if (other == com.google.apps.events.subscriptions.v1.PayloadOptions.getDefaultInstance()) + return this; + if (other.getIncludeResource() != false) { + setIncludeResource(other.getIncludeResource()); + } + if (other.hasFieldMask()) { + mergeFieldMask(other.getFieldMask()); + } + 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: + { + includeResource_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getFieldMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean includeResource_; + /** + * + * + *
+     * Optional. Whether the event payload includes data about the resource that
+     * changed. For example, for an event where a Google Chat message was created,
+     * whether the payload contains data about the
+     * [`Message`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages)
+     * resource. If false, the event payload only includes the name of the changed
+     * resource.
+     * 
+ * + * bool include_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The includeResource. + */ + @java.lang.Override + public boolean getIncludeResource() { + return includeResource_; + } + /** + * + * + *
+     * Optional. Whether the event payload includes data about the resource that
+     * changed. For example, for an event where a Google Chat message was created,
+     * whether the payload contains data about the
+     * [`Message`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages)
+     * resource. If false, the event payload only includes the name of the changed
+     * resource.
+     * 
+ * + * bool include_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The includeResource to set. + * @return This builder for chaining. + */ + public Builder setIncludeResource(boolean value) { + + includeResource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether the event payload includes data about the resource that
+     * changed. For example, for an event where a Google Chat message was created,
+     * whether the payload contains data about the
+     * [`Message`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages)
+     * resource. If false, the event payload only includes the name of the changed
+     * resource.
+     * 
+ * + * bool include_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIncludeResource() { + bitField0_ = (bitField0_ & ~0x00000001); + includeResource_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask fieldMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + fieldMaskBuilder_; + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + public boolean hasFieldMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + public com.google.protobuf.FieldMask getFieldMask() { + if (fieldMaskBuilder_ == null) { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } else { + return fieldMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fieldMask_ = value; + } else { + fieldMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (fieldMaskBuilder_ == null) { + fieldMask_ = builderForValue.build(); + } else { + fieldMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && fieldMask_ != null + && fieldMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getFieldMaskBuilder().mergeFrom(value); + } else { + fieldMask_ = value; + } + } else { + fieldMaskBuilder_.mergeFrom(value); + } + if (fieldMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFieldMask() { + bitField0_ = (bitField0_ & ~0x00000002); + fieldMask_ = null; + if (fieldMaskBuilder_ != null) { + fieldMaskBuilder_.dispose(); + fieldMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFieldMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + if (fieldMaskBuilder_ != null) { + return fieldMaskBuilder_.getMessageOrBuilder(); + } else { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + } + /** + * + * + *
+     * Optional. If `include_resource` is set to `true`, the list of fields to
+     * include in the event payload. Separate fields with a comma. For example, to
+     * include a Google Chat message's sender and create time, enter
+     * `message.sender,message.createTime`. If omitted, the payload includes all
+     * fields for the resource.
+     *
+     * If you specify a field that doesn't exist for the resource, the system
+     * ignores the field.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getFieldMaskFieldBuilder() { + if (fieldMaskBuilder_ == null) { + fieldMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getFieldMask(), getParentForChildren(), isClean()); + fieldMask_ = null; + } + return fieldMaskBuilder_; + } + + @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.apps.events.subscriptions.v1.PayloadOptions) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.PayloadOptions) + private static final com.google.apps.events.subscriptions.v1.PayloadOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.PayloadOptions(); + } + + public static com.google.apps.events.subscriptions.v1.PayloadOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PayloadOptions 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.apps.events.subscriptions.v1.PayloadOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/PayloadOptionsOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/PayloadOptionsOrBuilder.java new file mode 100644 index 000000000000..9d6fd8b93b0d --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/PayloadOptionsOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscription_resource.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface PayloadOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.PayloadOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Whether the event payload includes data about the resource that
+   * changed. For example, for an event where a Google Chat message was created,
+   * whether the payload contains data about the
+   * [`Message`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages)
+   * resource. If false, the event payload only includes the name of the changed
+   * resource.
+   * 
+ * + * bool include_resource = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The includeResource. + */ + boolean getIncludeResource(); + + /** + * + * + *
+   * Optional. If `include_resource` is set to `true`, the list of fields to
+   * include in the event payload. Separate fields with a comma. For example, to
+   * include a Google Chat message's sender and create time, enter
+   * `message.sender,message.createTime`. If omitted, the payload includes all
+   * fields for the resource.
+   *
+   * If you specify a field that doesn't exist for the resource, the system
+   * ignores the field.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + boolean hasFieldMask(); + /** + * + * + *
+   * Optional. If `include_resource` is set to `true`, the list of fields to
+   * include in the event payload. Separate fields with a comma. For example, to
+   * include a Google Chat message's sender and create time, enter
+   * `message.sender,message.createTime`. If omitted, the payload includes all
+   * fields for the resource.
+   *
+   * If you specify a field that doesn't exist for the resource, the system
+   * ignores the field.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + com.google.protobuf.FieldMask getFieldMask(); + /** + * + * + *
+   * Optional. If `include_resource` is set to `true`, the list of fields to
+   * include in the event payload. Separate fields with a comma. For example, to
+   * include a Google Chat message's sender and create time, enter
+   * `message.sender,message.createTime`. If omitted, the payload includes all
+   * fields for the resource.
+   *
+   * If you specify a field that doesn't exist for the resource, the system
+   * ignores the field.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionMetadata.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionMetadata.java new file mode 100644 index 000000000000..692ad96df592 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionMetadata.java @@ -0,0 +1,445 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * Metadata for ReactivateSubscription LRO.
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata} + */ +public final class ReactivateSubscriptionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) + ReactivateSubscriptionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReactivateSubscriptionMetadata.newBuilder() to construct. + private ReactivateSubscriptionMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReactivateSubscriptionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReactivateSubscriptionMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata other = + (com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata 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.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata 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.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + 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.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata 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.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata 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; + } + /** + * + * + *
+   * Metadata for ReactivateSubscription LRO.
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata build() { + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata buildPartial() { + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata result = + new com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) { + return mergeFrom( + (com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata other) { + if (other + == com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) + private static final com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata(); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReactivateSubscriptionMetadata 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.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionMetadataOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionMetadataOrBuilder.java new file mode 100644 index 000000000000..0aece74b8d6c --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionMetadataOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface ReactivateSubscriptionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionRequest.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionRequest.java new file mode 100644 index 000000000000..f59ccc48c3b4 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionRequest.java @@ -0,0 +1,667 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The request message for
+ * [SubscriptionsService.ReactivateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription].
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest} + */ +public final class ReactivateSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) + ReactivateSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReactivateSubscriptionRequest.newBuilder() to construct. + private ReactivateSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReactivateSubscriptionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReactivateSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * 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. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * 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.apps.events.subscriptions.v1.ReactivateSubscriptionRequest)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest other = + (com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) 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.apps.events.subscriptions.v1.ReactivateSubscriptionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest 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.apps.events.subscriptions.v1.ReactivateSubscriptionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest 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.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + 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.apps.events.subscriptions.v1.ReactivateSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest 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.apps.events.subscriptions.v1.ReactivateSubscriptionRequest 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
+   * [SubscriptionsService.ReactivateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription].
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest build() { + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest buildPartial() { + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest result = + new com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) { + return mergeFrom( + (com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest other) { + if (other + == com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * 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. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * 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. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) + private static final com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest(); + } + + public static com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReactivateSubscriptionRequest 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.apps.events.subscriptions.v1.ReactivateSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionRequestOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..6aebee0968e4 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/ReactivateSubscriptionRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface ReactivateSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * 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-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/Subscription.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/Subscription.java new file mode 100644 index 000000000000..84e3585f6433 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/Subscription.java @@ -0,0 +1,4917 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscription_resource.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * A subscription to receive events about a Google Workspace resource. To learn
+ * more about subscriptions, see the [Google Workspace Events API
+ * overview](https://developers.google.com/workspace/events/guides).
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.Subscription} + */ +public final class Subscription extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.Subscription) + SubscriptionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Subscription.newBuilder() to construct. + private Subscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Subscription() { + name_ = ""; + uid_ = ""; + targetResource_ = ""; + eventTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + state_ = 0; + suspensionReason_ = 0; + authority_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Subscription(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_Subscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_Subscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.Subscription.class, + com.google.apps.events.subscriptions.v1.Subscription.Builder.class); + } + + /** + * + * + *
+   * Possible states for the subscription.
+   * 
+ * + * Protobuf enum {@code google.apps.events.subscriptions.v1.Subscription.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The subscription is active and can receive and deliver events to its
+     * notification endpoint.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * The subscription is unable to receive events due to an error.
+     * To identify the error, see the
+     * [`suspension_reason`][google.apps.events.subscriptions.v1.Subscription.suspension_reason]
+     * field.
+     * 
+ * + * SUSPENDED = 2; + */ + SUSPENDED(2), + /** + * + * + *
+     * The subscription is deleted.
+     * 
+ * + * DELETED = 3; + */ + DELETED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The subscription is active and can receive and deliver events to its
+     * notification endpoint.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * The subscription is unable to receive events due to an error.
+     * To identify the error, see the
+     * [`suspension_reason`][google.apps.events.subscriptions.v1.Subscription.suspension_reason]
+     * field.
+     * 
+ * + * SUSPENDED = 2; + */ + public static final int SUSPENDED_VALUE = 2; + /** + * + * + *
+     * The subscription is deleted.
+     * 
+ * + * DELETED = 3; + */ + public static final int DELETED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return SUSPENDED; + case 3: + return DELETED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.Subscription.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.events.subscriptions.v1.Subscription.State) + } + + /** + * + * + *
+   * Possible errors for a subscription.
+   * 
+ * + * Protobuf enum {@code google.apps.events.subscriptions.v1.Subscription.ErrorType} + */ + public enum ErrorType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * ERROR_TYPE_UNSPECIFIED = 0; + */ + ERROR_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The authorizing user has revoked the grant of one or more OAuth scopes.
+     * To learn more about authorization for Google Workspace, see [Configure
+     * the OAuth consent
+     * screen](https://developers.google.com/workspace/guides/configure-oauth-consent#choose-scopes).
+     * 
+ * + * USER_SCOPE_REVOKED = 1; + */ + USER_SCOPE_REVOKED(1), + /** + * + * + *
+     * The target resource for the subscription no longer exists.
+     * 
+ * + * RESOURCE_DELETED = 2; + */ + RESOURCE_DELETED(2), + /** + * + * + *
+     * The user that authorized the creation of the subscription no longer has
+     * access to the subscription's target resource.
+     * 
+ * + * USER_AUTHORIZATION_FAILURE = 3; + */ + USER_AUTHORIZATION_FAILURE(3), + /** + * + * + *
+     * The Google Workspace application doesn't have access to deliver
+     * events to your subscription's notification endpoint.
+     * 
+ * + * ENDPOINT_PERMISSION_DENIED = 4; + */ + ENDPOINT_PERMISSION_DENIED(4), + /** + * + * + *
+     * The subscription's notification endpoint doesn't exist, or the endpoint
+     * can't be found in the Google Cloud project where you created the
+     * subscription.
+     * 
+ * + * ENDPOINT_NOT_FOUND = 6; + */ + ENDPOINT_NOT_FOUND(6), + /** + * + * + *
+     * The subscription's notification endpoint failed to receive events due to
+     * insufficient quota or reaching rate limiting.
+     * 
+ * + * ENDPOINT_RESOURCE_EXHAUSTED = 7; + */ + ENDPOINT_RESOURCE_EXHAUSTED(7), + /** + * + * + *
+     * An unidentified error has occurred.
+     * 
+ * + * OTHER = 5; + */ + OTHER(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * ERROR_TYPE_UNSPECIFIED = 0; + */ + public static final int ERROR_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The authorizing user has revoked the grant of one or more OAuth scopes.
+     * To learn more about authorization for Google Workspace, see [Configure
+     * the OAuth consent
+     * screen](https://developers.google.com/workspace/guides/configure-oauth-consent#choose-scopes).
+     * 
+ * + * USER_SCOPE_REVOKED = 1; + */ + public static final int USER_SCOPE_REVOKED_VALUE = 1; + /** + * + * + *
+     * The target resource for the subscription no longer exists.
+     * 
+ * + * RESOURCE_DELETED = 2; + */ + public static final int RESOURCE_DELETED_VALUE = 2; + /** + * + * + *
+     * The user that authorized the creation of the subscription no longer has
+     * access to the subscription's target resource.
+     * 
+ * + * USER_AUTHORIZATION_FAILURE = 3; + */ + public static final int USER_AUTHORIZATION_FAILURE_VALUE = 3; + /** + * + * + *
+     * The Google Workspace application doesn't have access to deliver
+     * events to your subscription's notification endpoint.
+     * 
+ * + * ENDPOINT_PERMISSION_DENIED = 4; + */ + public static final int ENDPOINT_PERMISSION_DENIED_VALUE = 4; + /** + * + * + *
+     * The subscription's notification endpoint doesn't exist, or the endpoint
+     * can't be found in the Google Cloud project where you created the
+     * subscription.
+     * 
+ * + * ENDPOINT_NOT_FOUND = 6; + */ + public static final int ENDPOINT_NOT_FOUND_VALUE = 6; + /** + * + * + *
+     * The subscription's notification endpoint failed to receive events due to
+     * insufficient quota or reaching rate limiting.
+     * 
+ * + * ENDPOINT_RESOURCE_EXHAUSTED = 7; + */ + public static final int ENDPOINT_RESOURCE_EXHAUSTED_VALUE = 7; + /** + * + * + *
+     * An unidentified error has occurred.
+     * 
+ * + * OTHER = 5; + */ + public static final int OTHER_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ErrorType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ErrorType forNumber(int value) { + switch (value) { + case 0: + return ERROR_TYPE_UNSPECIFIED; + case 1: + return USER_SCOPE_REVOKED; + case 2: + return RESOURCE_DELETED; + case 3: + return USER_AUTHORIZATION_FAILURE; + case 4: + return ENDPOINT_PERMISSION_DENIED; + case 6: + return ENDPOINT_NOT_FOUND; + case 7: + return ENDPOINT_RESOURCE_EXHAUSTED; + case 5: + return OTHER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ErrorType findValueByNumber(int number) { + return ErrorType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.Subscription.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final ErrorType[] VALUES = values(); + + public static ErrorType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ErrorType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.events.subscriptions.v1.Subscription.ErrorType) + } + + private int bitField0_; + private int expirationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXPIRE_TIME(13), + TTL(14), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 13: + return EXPIRE_TIME; + case 14: + return TTL; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 13; + /** + * + * + *
+   * Non-empty default. The timestamp in UTC when the subscription expires.
+   * Always displayed on output, regardless of what was used on input.
+   * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 13; + } + /** + * + * + *
+   * Non-empty default. The timestamp in UTC when the subscription expires.
+   * Always displayed on output, regardless of what was used on input.
+   * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Non-empty default. The timestamp in UTC when the subscription expires.
+   * Always displayed on output, regardless of what was used on input.
+   * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 14; + /** + * + * + *
+   * Input only. The time-to-live (TTL) or duration for the subscription. If
+   * unspecified or set to `0`, uses the maximum possible duration.
+   * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 14; + } + /** + * + * + *
+   * Input only. The time-to-live (TTL) or duration for the subscription. If
+   * unspecified or set to `0`, uses the maximum possible duration.
+   * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+   * Input only. The time-to-live (TTL) or duration for the subscription. If
+   * unspecified or set to `0`, uses the maximum possible duration.
+   * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Optional. Immutable. Identifier. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @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; + } + } + /** + * + * + *
+   * Optional. Immutable. Identifier. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @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 UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. System-assigned unique identifier for the subscription.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. System-assigned unique identifier for the subscription.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_RESOURCE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetResource_ = ""; + /** + * + * + *
+   * Required. Immutable. The Google Workspace resource that's monitored for
+   * events, formatted as the [full resource
+   * name](https://google.aip.dev/122#full-resource-names). To learn about
+   * target resources, see [Supported Google Workspace
+   * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+   *
+   * A user can only authorize your app to create one subscription for a given
+   * target resource. If your app tries to create another subscription with the
+   * same user credentials, the request returns an `ALREADY_EXISTS` error.
+   * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The targetResource. + */ + @java.lang.Override + public java.lang.String getTargetResource() { + java.lang.Object ref = targetResource_; + 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(); + targetResource_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Immutable. The Google Workspace resource that's monitored for
+   * events, formatted as the [full resource
+   * name](https://google.aip.dev/122#full-resource-names). To learn about
+   * target resources, see [Supported Google Workspace
+   * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+   *
+   * A user can only authorize your app to create one subscription for a given
+   * target resource. If your app tries to create another subscription with the
+   * same user credentials, the request returns an `ALREADY_EXISTS` error.
+   * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for targetResource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetResourceBytes() { + java.lang.Object ref = targetResource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TYPES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList eventTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the eventTypes. + */ + public com.google.protobuf.ProtocolStringList getEventTypesList() { + return eventTypes_; + } + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of eventTypes. + */ + public int getEventTypesCount() { + return eventTypes_.size(); + } + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The eventTypes at the given index. + */ + public java.lang.String getEventTypes(int index) { + return eventTypes_.get(index); + } + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The bytes of the eventTypes at the given index. + */ + public com.google.protobuf.ByteString getEventTypesBytes(int index) { + return eventTypes_.getByteString(index); + } + + public static final int PAYLOAD_OPTIONS_FIELD_NUMBER = 6; + private com.google.apps.events.subscriptions.v1.PayloadOptions payloadOptions_; + /** + * + * + *
+   * Optional. Options about what data to include in the event payload. Only
+   * supported for Google Chat events.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the payloadOptions field is set. + */ + @java.lang.Override + public boolean hasPayloadOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Options about what data to include in the event payload. Only
+   * supported for Google Chat events.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The payloadOptions. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.PayloadOptions getPayloadOptions() { + return payloadOptions_ == null + ? com.google.apps.events.subscriptions.v1.PayloadOptions.getDefaultInstance() + : payloadOptions_; + } + /** + * + * + *
+   * Optional. Options about what data to include in the event payload. Only
+   * supported for Google Chat events.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.PayloadOptionsOrBuilder + getPayloadOptionsOrBuilder() { + return payloadOptions_ == null + ? com.google.apps.events.subscriptions.v1.PayloadOptions.getDefaultInstance() + : payloadOptions_; + } + + public static final int NOTIFICATION_ENDPOINT_FIELD_NUMBER = 7; + private com.google.apps.events.subscriptions.v1.NotificationEndpoint notificationEndpoint_; + /** + * + * + *
+   * Required. Immutable. The endpoint where the subscription delivers events,
+   * such as a Pub/Sub topic.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the notificationEndpoint field is set. + */ + @java.lang.Override + public boolean hasNotificationEndpoint() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. Immutable. The endpoint where the subscription delivers events,
+   * such as a Pub/Sub topic.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The notificationEndpoint. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.NotificationEndpoint getNotificationEndpoint() { + return notificationEndpoint_ == null + ? com.google.apps.events.subscriptions.v1.NotificationEndpoint.getDefaultInstance() + : notificationEndpoint_; + } + /** + * + * + *
+   * Required. Immutable. The endpoint where the subscription delivers events,
+   * such as a Pub/Sub topic.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.NotificationEndpointOrBuilder + getNotificationEndpointOrBuilder() { + return notificationEndpoint_ == null + ? com.google.apps.events.subscriptions.v1.NotificationEndpoint.getDefaultInstance() + : notificationEndpoint_; + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The state of the subscription. Determines whether the
+   * subscription can receive events and deliver them to the notification
+   * endpoint.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The state of the subscription. Determines whether the
+   * subscription can receive events and deliver them to the notification
+   * endpoint.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription.State getState() { + com.google.apps.events.subscriptions.v1.Subscription.State result = + com.google.apps.events.subscriptions.v1.Subscription.State.forNumber(state_); + return result == null + ? com.google.apps.events.subscriptions.v1.Subscription.State.UNRECOGNIZED + : result; + } + + public static final int SUSPENSION_REASON_FIELD_NUMBER = 18; + private int suspensionReason_ = 0; + /** + * + * + *
+   * Output only. The error that suspended the subscription.
+   *
+   * To reactivate the subscription, resolve the error and call the
+   * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+   * method.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for suspensionReason. + */ + @java.lang.Override + public int getSuspensionReasonValue() { + return suspensionReason_; + } + /** + * + * + *
+   * Output only. The error that suspended the subscription.
+   *
+   * To reactivate the subscription, resolve the error and call the
+   * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+   * method.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suspensionReason. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription.ErrorType getSuspensionReason() { + com.google.apps.events.subscriptions.v1.Subscription.ErrorType result = + com.google.apps.events.subscriptions.v1.Subscription.ErrorType.forNumber(suspensionReason_); + return result == null + ? com.google.apps.events.subscriptions.v1.Subscription.ErrorType.UNRECOGNIZED + : result; + } + + public static final int AUTHORITY_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object authority_ = ""; + /** + * + * + *
+   * Output only. The user who authorized the creation of the
+   * subscription.
+   *
+   * Format: `users/{user}`
+   *
+   * For Google Workspace users, the `{user}` value is the
+   * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+   * field from the Directory API.
+   * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The authority. + */ + @java.lang.Override + public java.lang.String getAuthority() { + java.lang.Object ref = authority_; + 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(); + authority_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The user who authorized the creation of the
+   * subscription.
+   *
+   * Format: `users/{user}`
+   *
+   * For Google Workspace users, the `{user}` value is the
+   * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+   * field from the Directory API.
+   * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authority. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorityBytes() { + java.lang.Object ref = authority_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authority_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the subscription is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. The time when the subscription is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the subscription is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time that the subscription is updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. The last time that the subscription is updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.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 time that the subscription is updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int RECONCILING_FIELD_NUMBER = 15; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. If `true`, the subscription is in the process of being
+   * updated.
+   * 
+ * + * bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ETAG_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. This checksum is computed by the server based on the value of
+   * other fields, and might be sent on update requests to ensure the client has
+   * an up-to-date value before proceeding.
+   * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. This checksum is computed by the server based on the value of
+   * other fields, and might be sent on update requests to ensure the client has
+   * an up-to-date value before proceeding.
+   * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetResource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, targetResource_); + } + for (int i = 0; i < eventTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, eventTypes_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getPayloadOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getNotificationEndpoint()); + } + if (state_ + != com.google.apps.events.subscriptions.v1.Subscription.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authority_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, authority_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(11, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(12, getUpdateTime()); + } + if (expirationCase_ == 13) { + output.writeMessage(13, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 14) { + output.writeMessage(14, (com.google.protobuf.Duration) expiration_); + } + if (reconciling_ != false) { + output.writeBool(15, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, etag_); + } + if (suspensionReason_ + != com.google.apps.events.subscriptions.v1.Subscription.ErrorType.ERROR_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(18, suspensionReason_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetResource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, targetResource_); + } + { + int dataSize = 0; + for (int i = 0; i < eventTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(eventTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getEventTypesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPayloadOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getNotificationEndpoint()); + } + if (state_ + != com.google.apps.events.subscriptions.v1.Subscription.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authority_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, authority_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUpdateTime()); + } + if (expirationCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, (com.google.protobuf.Duration) expiration_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(15, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, etag_); + } + if (suspensionReason_ + != com.google.apps.events.subscriptions.v1.Subscription.ErrorType.ERROR_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(18, suspensionReason_); + } + 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.apps.events.subscriptions.v1.Subscription)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.Subscription other = + (com.google.apps.events.subscriptions.v1.Subscription) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (!getTargetResource().equals(other.getTargetResource())) return false; + if (!getEventTypesList().equals(other.getEventTypesList())) return false; + if (hasPayloadOptions() != other.hasPayloadOptions()) return false; + if (hasPayloadOptions()) { + if (!getPayloadOptions().equals(other.getPayloadOptions())) return false; + } + if (hasNotificationEndpoint() != other.hasNotificationEndpoint()) return false; + if (hasNotificationEndpoint()) { + if (!getNotificationEndpoint().equals(other.getNotificationEndpoint())) return false; + } + if (state_ != other.state_) return false; + if (suspensionReason_ != other.suspensionReason_) return false; + if (!getAuthority().equals(other.getAuthority())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (getReconciling() != other.getReconciling()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 13: + if (!getExpireTime().equals(other.getExpireTime())) return false; + break; + case 14: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + TARGET_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getTargetResource().hashCode(); + if (getEventTypesCount() > 0) { + hash = (37 * hash) + EVENT_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getEventTypesList().hashCode(); + } + if (hasPayloadOptions()) { + hash = (37 * hash) + PAYLOAD_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPayloadOptions().hashCode(); + } + if (hasNotificationEndpoint()) { + hash = (37 * hash) + NOTIFICATION_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getNotificationEndpoint().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + SUSPENSION_REASON_FIELD_NUMBER; + hash = (53 * hash) + suspensionReason_; + hash = (37 * hash) + AUTHORITY_FIELD_NUMBER; + hash = (53 * hash) + getAuthority().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + switch (expirationCase_) { + case 13: + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + break; + case 14: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.Subscription parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.apps.events.subscriptions.v1.Subscription prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A subscription to receive events about a Google Workspace resource. To learn
+   * more about subscriptions, see the [Google Workspace Events API
+   * overview](https://developers.google.com/workspace/events/guides).
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.Subscription} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.Subscription) + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_Subscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_Subscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.Subscription.class, + com.google.apps.events.subscriptions.v1.Subscription.Builder.class); + } + + // Construct using com.google.apps.events.subscriptions.v1.Subscription.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPayloadOptionsFieldBuilder(); + getNotificationEndpointFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.clear(); + } + if (ttlBuilder_ != null) { + ttlBuilder_.clear(); + } + name_ = ""; + uid_ = ""; + targetResource_ = ""; + eventTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + payloadOptions_ = null; + if (payloadOptionsBuilder_ != null) { + payloadOptionsBuilder_.dispose(); + payloadOptionsBuilder_ = null; + } + notificationEndpoint_ = null; + if (notificationEndpointBuilder_ != null) { + notificationEndpointBuilder_.dispose(); + notificationEndpointBuilder_ = null; + } + state_ = 0; + suspensionReason_ = 0; + authority_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + reconciling_ = false; + etag_ = ""; + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionResourceProto + .internal_static_google_apps_events_subscriptions_v1_Subscription_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription build() { + com.google.apps.events.subscriptions.v1.Subscription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription buildPartial() { + com.google.apps.events.subscriptions.v1.Subscription result = + new com.google.apps.events.subscriptions.v1.Subscription(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.events.subscriptions.v1.Subscription result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.targetResource_ = targetResource_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + eventTypes_.makeImmutable(); + result.eventTypes_ = eventTypes_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.payloadOptions_ = + payloadOptionsBuilder_ == null ? payloadOptions_ : payloadOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.notificationEndpoint_ = + notificationEndpointBuilder_ == null + ? notificationEndpoint_ + : notificationEndpointBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.suspensionReason_ = suspensionReason_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.authority_ = authority_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.etag_ = etag_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.apps.events.subscriptions.v1.Subscription result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 13 && expireTimeBuilder_ != null) { + result.expiration_ = expireTimeBuilder_.build(); + } + if (expirationCase_ == 14 && ttlBuilder_ != null) { + result.expiration_ = ttlBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.Subscription) { + return mergeFrom((com.google.apps.events.subscriptions.v1.Subscription) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.events.subscriptions.v1.Subscription other) { + if (other == com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getTargetResource().isEmpty()) { + targetResource_ = other.targetResource_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.eventTypes_.isEmpty()) { + if (eventTypes_.isEmpty()) { + eventTypes_ = other.eventTypes_; + bitField0_ |= 0x00000020; + } else { + ensureEventTypesIsMutable(); + eventTypes_.addAll(other.eventTypes_); + } + onChanged(); + } + if (other.hasPayloadOptions()) { + mergePayloadOptions(other.getPayloadOptions()); + } + if (other.hasNotificationEndpoint()) { + mergeNotificationEndpoint(other.getNotificationEndpoint()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.suspensionReason_ != 0) { + setSuspensionReasonValue(other.getSuspensionReasonValue()); + } + if (!other.getAuthority().isEmpty()) { + authority_ = other.authority_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00004000; + onChanged(); + } + switch (other.getExpirationCase()) { + case EXPIRE_TIME: + { + mergeExpireTime(other.getExpireTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case EXPIRATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 34: + { + targetResource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureEventTypesIsMutable(); + eventTypes_.add(s); + break; + } // case 42 + case 50: + { + input.readMessage(getPayloadOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + input.readMessage( + getNotificationEndpointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 82: + { + authority_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 90: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 98 + case 106: + { + input.readMessage(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 13; + break; + } // case 106 + case 114: + { + input.readMessage(getTtlFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 14; + break; + } // case 114 + case 120: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 120 + case 138: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 138 + case 144: + { + suspensionReason_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 144 + 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 expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 13; + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 13) { + return expireTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 13; + return this; + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 13; + return this; + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 13 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 13) { + expireTimeBuilder_.mergeFrom(value); + } else { + expireTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 13; + return this; + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 13) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 13) { + expirationCase_ = 0; + expiration_ = null; + } + expireTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if ((expirationCase_ == 13) && (expireTimeBuilder_ != null)) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Non-empty default. The timestamp in UTC when the subscription expires.
+     * Always displayed on output, regardless of what was used on input.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + if (!(expirationCase_ == 13)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 13; + onChanged(); + return expireTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 14; + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (expirationCase_ == 14) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + expirationCase_ = 14; + return this; + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 14; + return this; + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (expirationCase_ == 14 + && expiration_ != com.google.protobuf.Duration.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 14) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + expirationCase_ = 14; + return this; + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 14) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 14) { + expirationCase_ = 0; + expiration_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((expirationCase_ == 14) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The time-to-live (TTL) or duration for the subscription. If
+     * unspecified or set to `0`, uses the maximum possible duration.
+     * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(expirationCase_ == 14)) { + expiration_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 14; + onChanged(); + return ttlBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Optional. Immutable. Identifier. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @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; + } + } + /** + * + * + *
+     * Optional. Immutable. Identifier. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @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; + } + } + /** + * + * + *
+     * Optional. Immutable. Identifier. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Identifier. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Identifier. Resource name of the subscription.
+     *
+     * Format: `subscriptions/{subscription}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. System-assigned unique identifier for the subscription.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. System-assigned unique identifier for the subscription.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. System-assigned unique identifier for the subscription.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System-assigned unique identifier for the subscription.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System-assigned unique identifier for the subscription.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object targetResource_ = ""; + /** + * + * + *
+     * Required. Immutable. The Google Workspace resource that's monitored for
+     * events, formatted as the [full resource
+     * name](https://google.aip.dev/122#full-resource-names). To learn about
+     * target resources, see [Supported Google Workspace
+     * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+     *
+     * A user can only authorize your app to create one subscription for a given
+     * target resource. If your app tries to create another subscription with the
+     * same user credentials, the request returns an `ALREADY_EXISTS` error.
+     * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The targetResource. + */ + public java.lang.String getTargetResource() { + java.lang.Object ref = targetResource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetResource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Immutable. The Google Workspace resource that's monitored for
+     * events, formatted as the [full resource
+     * name](https://google.aip.dev/122#full-resource-names). To learn about
+     * target resources, see [Supported Google Workspace
+     * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+     *
+     * A user can only authorize your app to create one subscription for a given
+     * target resource. If your app tries to create another subscription with the
+     * same user credentials, the request returns an `ALREADY_EXISTS` error.
+     * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for targetResource. + */ + public com.google.protobuf.ByteString getTargetResourceBytes() { + java.lang.Object ref = targetResource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Immutable. The Google Workspace resource that's monitored for
+     * events, formatted as the [full resource
+     * name](https://google.aip.dev/122#full-resource-names). To learn about
+     * target resources, see [Supported Google Workspace
+     * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+     *
+     * A user can only authorize your app to create one subscription for a given
+     * target resource. If your app tries to create another subscription with the
+     * same user credentials, the request returns an `ALREADY_EXISTS` error.
+     * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The targetResource to set. + * @return This builder for chaining. + */ + public Builder setTargetResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetResource_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The Google Workspace resource that's monitored for
+     * events, formatted as the [full resource
+     * name](https://google.aip.dev/122#full-resource-names). To learn about
+     * target resources, see [Supported Google Workspace
+     * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+     *
+     * A user can only authorize your app to create one subscription for a given
+     * target resource. If your app tries to create another subscription with the
+     * same user credentials, the request returns an `ALREADY_EXISTS` error.
+     * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTargetResource() { + targetResource_ = getDefaultInstance().getTargetResource(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The Google Workspace resource that's monitored for
+     * events, formatted as the [full resource
+     * name](https://google.aip.dev/122#full-resource-names). To learn about
+     * target resources, see [Supported Google Workspace
+     * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+     *
+     * A user can only authorize your app to create one subscription for a given
+     * target resource. If your app tries to create another subscription with the
+     * same user credentials, the request returns an `ALREADY_EXISTS` error.
+     * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for targetResource to set. + * @return This builder for chaining. + */ + public Builder setTargetResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetResource_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList eventTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureEventTypesIsMutable() { + if (!eventTypes_.isModifiable()) { + eventTypes_ = new com.google.protobuf.LazyStringArrayList(eventTypes_); + } + bitField0_ |= 0x00000020; + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the eventTypes. + */ + public com.google.protobuf.ProtocolStringList getEventTypesList() { + eventTypes_.makeImmutable(); + return eventTypes_; + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of eventTypes. + */ + public int getEventTypesCount() { + return eventTypes_.size(); + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The eventTypes at the given index. + */ + public java.lang.String getEventTypes(int index) { + return eventTypes_.get(index); + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The bytes of the eventTypes at the given index. + */ + public com.google.protobuf.ByteString getEventTypesBytes(int index) { + return eventTypes_.getByteString(index); + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index to set the value at. + * @param value The eventTypes to set. + * @return This builder for chaining. + */ + public Builder setEventTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventTypesIsMutable(); + eventTypes_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The eventTypes to add. + * @return This builder for chaining. + */ + public Builder addEventTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventTypesIsMutable(); + eventTypes_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The eventTypes to add. + * @return This builder for chaining. + */ + public Builder addAllEventTypes(java.lang.Iterable values) { + ensureEventTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventTypes_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearEventTypes() { + eventTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Unordered list. Input for creating a subscription.
+     * Otherwise, output only. One or more types of events to receive about the
+     * target resource. Formatted according to the CloudEvents specification.
+     *
+     * For a list of supported event types, see the following documentation:
+     *
+     * * [Google Chat
+     * events](https://developers.google.com/workspace/events/guides/events-chat)
+     * * [Google Meet
+     * events](https://developers.google.com/workspace/events/guides/events-meet)
+     *
+     * By default, you also receive events about the [lifecycle of your
+     * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+     * You don't need to specify lifecycle events for this field.
+     *
+     * If you specify an event type that doesn't exist for the target resource,
+     * the request returns an HTTP `400 Bad Request` status code.
+     * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes of the eventTypes to add. + * @return This builder for chaining. + */ + public Builder addEventTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEventTypesIsMutable(); + eventTypes_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.apps.events.subscriptions.v1.PayloadOptions payloadOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.PayloadOptions, + com.google.apps.events.subscriptions.v1.PayloadOptions.Builder, + com.google.apps.events.subscriptions.v1.PayloadOptionsOrBuilder> + payloadOptionsBuilder_; + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the payloadOptions field is set. + */ + public boolean hasPayloadOptions() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The payloadOptions. + */ + public com.google.apps.events.subscriptions.v1.PayloadOptions getPayloadOptions() { + if (payloadOptionsBuilder_ == null) { + return payloadOptions_ == null + ? com.google.apps.events.subscriptions.v1.PayloadOptions.getDefaultInstance() + : payloadOptions_; + } else { + return payloadOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPayloadOptions(com.google.apps.events.subscriptions.v1.PayloadOptions value) { + if (payloadOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payloadOptions_ = value; + } else { + payloadOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPayloadOptions( + com.google.apps.events.subscriptions.v1.PayloadOptions.Builder builderForValue) { + if (payloadOptionsBuilder_ == null) { + payloadOptions_ = builderForValue.build(); + } else { + payloadOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePayloadOptions( + com.google.apps.events.subscriptions.v1.PayloadOptions value) { + if (payloadOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && payloadOptions_ != null + && payloadOptions_ + != com.google.apps.events.subscriptions.v1.PayloadOptions.getDefaultInstance()) { + getPayloadOptionsBuilder().mergeFrom(value); + } else { + payloadOptions_ = value; + } + } else { + payloadOptionsBuilder_.mergeFrom(value); + } + if (payloadOptions_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPayloadOptions() { + bitField0_ = (bitField0_ & ~0x00000040); + payloadOptions_ = null; + if (payloadOptionsBuilder_ != null) { + payloadOptionsBuilder_.dispose(); + payloadOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.apps.events.subscriptions.v1.PayloadOptions.Builder + getPayloadOptionsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getPayloadOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.apps.events.subscriptions.v1.PayloadOptionsOrBuilder + getPayloadOptionsOrBuilder() { + if (payloadOptionsBuilder_ != null) { + return payloadOptionsBuilder_.getMessageOrBuilder(); + } else { + return payloadOptions_ == null + ? com.google.apps.events.subscriptions.v1.PayloadOptions.getDefaultInstance() + : payloadOptions_; + } + } + /** + * + * + *
+     * Optional. Options about what data to include in the event payload. Only
+     * supported for Google Chat events.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.PayloadOptions, + com.google.apps.events.subscriptions.v1.PayloadOptions.Builder, + com.google.apps.events.subscriptions.v1.PayloadOptionsOrBuilder> + getPayloadOptionsFieldBuilder() { + if (payloadOptionsBuilder_ == null) { + payloadOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.PayloadOptions, + com.google.apps.events.subscriptions.v1.PayloadOptions.Builder, + com.google.apps.events.subscriptions.v1.PayloadOptionsOrBuilder>( + getPayloadOptions(), getParentForChildren(), isClean()); + payloadOptions_ = null; + } + return payloadOptionsBuilder_; + } + + private com.google.apps.events.subscriptions.v1.NotificationEndpoint notificationEndpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.NotificationEndpoint, + com.google.apps.events.subscriptions.v1.NotificationEndpoint.Builder, + com.google.apps.events.subscriptions.v1.NotificationEndpointOrBuilder> + notificationEndpointBuilder_; + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the notificationEndpoint field is set. + */ + public boolean hasNotificationEndpoint() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The notificationEndpoint. + */ + public com.google.apps.events.subscriptions.v1.NotificationEndpoint getNotificationEndpoint() { + if (notificationEndpointBuilder_ == null) { + return notificationEndpoint_ == null + ? com.google.apps.events.subscriptions.v1.NotificationEndpoint.getDefaultInstance() + : notificationEndpoint_; + } else { + return notificationEndpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setNotificationEndpoint( + com.google.apps.events.subscriptions.v1.NotificationEndpoint value) { + if (notificationEndpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notificationEndpoint_ = value; + } else { + notificationEndpointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setNotificationEndpoint( + com.google.apps.events.subscriptions.v1.NotificationEndpoint.Builder builderForValue) { + if (notificationEndpointBuilder_ == null) { + notificationEndpoint_ = builderForValue.build(); + } else { + notificationEndpointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeNotificationEndpoint( + com.google.apps.events.subscriptions.v1.NotificationEndpoint value) { + if (notificationEndpointBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && notificationEndpoint_ != null + && notificationEndpoint_ + != com.google.apps.events.subscriptions.v1.NotificationEndpoint + .getDefaultInstance()) { + getNotificationEndpointBuilder().mergeFrom(value); + } else { + notificationEndpoint_ = value; + } + } else { + notificationEndpointBuilder_.mergeFrom(value); + } + if (notificationEndpoint_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearNotificationEndpoint() { + bitField0_ = (bitField0_ & ~0x00000080); + notificationEndpoint_ = null; + if (notificationEndpointBuilder_ != null) { + notificationEndpointBuilder_.dispose(); + notificationEndpointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.apps.events.subscriptions.v1.NotificationEndpoint.Builder + getNotificationEndpointBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getNotificationEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.apps.events.subscriptions.v1.NotificationEndpointOrBuilder + getNotificationEndpointOrBuilder() { + if (notificationEndpointBuilder_ != null) { + return notificationEndpointBuilder_.getMessageOrBuilder(); + } else { + return notificationEndpoint_ == null + ? com.google.apps.events.subscriptions.v1.NotificationEndpoint.getDefaultInstance() + : notificationEndpoint_; + } + } + /** + * + * + *
+     * Required. Immutable. The endpoint where the subscription delivers events,
+     * such as a Pub/Sub topic.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.NotificationEndpoint, + com.google.apps.events.subscriptions.v1.NotificationEndpoint.Builder, + com.google.apps.events.subscriptions.v1.NotificationEndpointOrBuilder> + getNotificationEndpointFieldBuilder() { + if (notificationEndpointBuilder_ == null) { + notificationEndpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.NotificationEndpoint, + com.google.apps.events.subscriptions.v1.NotificationEndpoint.Builder, + com.google.apps.events.subscriptions.v1.NotificationEndpointOrBuilder>( + getNotificationEndpoint(), getParentForChildren(), isClean()); + notificationEndpoint_ = null; + } + return notificationEndpointBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The state of the subscription. Determines whether the
+     * subscription can receive events and deliver them to the notification
+     * endpoint.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The state of the subscription. Determines whether the
+     * subscription can receive events and deliver them to the notification
+     * endpoint.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of the subscription. Determines whether the
+     * subscription can receive events and deliver them to the notification
+     * endpoint.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription.State getState() { + com.google.apps.events.subscriptions.v1.Subscription.State result = + com.google.apps.events.subscriptions.v1.Subscription.State.forNumber(state_); + return result == null + ? com.google.apps.events.subscriptions.v1.Subscription.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The state of the subscription. Determines whether the
+     * subscription can receive events and deliver them to the notification
+     * endpoint.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.apps.events.subscriptions.v1.Subscription.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of the subscription. Determines whether the
+     * subscription can receive events and deliver them to the notification
+     * endpoint.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000100); + state_ = 0; + onChanged(); + return this; + } + + private int suspensionReason_ = 0; + /** + * + * + *
+     * Output only. The error that suspended the subscription.
+     *
+     * To reactivate the subscription, resolve the error and call the
+     * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+     * method.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for suspensionReason. + */ + @java.lang.Override + public int getSuspensionReasonValue() { + return suspensionReason_; + } + /** + * + * + *
+     * Output only. The error that suspended the subscription.
+     *
+     * To reactivate the subscription, resolve the error and call the
+     * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+     * method.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for suspensionReason to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReasonValue(int value) { + suspensionReason_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The error that suspended the subscription.
+     *
+     * To reactivate the subscription, resolve the error and call the
+     * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+     * method.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suspensionReason. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription.ErrorType getSuspensionReason() { + com.google.apps.events.subscriptions.v1.Subscription.ErrorType result = + com.google.apps.events.subscriptions.v1.Subscription.ErrorType.forNumber( + suspensionReason_); + return result == null + ? com.google.apps.events.subscriptions.v1.Subscription.ErrorType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The error that suspended the subscription.
+     *
+     * To reactivate the subscription, resolve the error and call the
+     * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+     * method.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The suspensionReason to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReason( + com.google.apps.events.subscriptions.v1.Subscription.ErrorType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + suspensionReason_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The error that suspended the subscription.
+     *
+     * To reactivate the subscription, resolve the error and call the
+     * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+     * method.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSuspensionReason() { + bitField0_ = (bitField0_ & ~0x00000200); + suspensionReason_ = 0; + onChanged(); + return this; + } + + private java.lang.Object authority_ = ""; + /** + * + * + *
+     * Output only. The user who authorized the creation of the
+     * subscription.
+     *
+     * Format: `users/{user}`
+     *
+     * For Google Workspace users, the `{user}` value is the
+     * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+     * field from the Directory API.
+     * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The authority. + */ + public java.lang.String getAuthority() { + java.lang.Object ref = authority_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authority_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The user who authorized the creation of the
+     * subscription.
+     *
+     * Format: `users/{user}`
+     *
+     * For Google Workspace users, the `{user}` value is the
+     * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+     * field from the Directory API.
+     * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authority. + */ + public com.google.protobuf.ByteString getAuthorityBytes() { + java.lang.Object ref = authority_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authority_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The user who authorized the creation of the
+     * subscription.
+     *
+     * Format: `users/{user}`
+     *
+     * For Google Workspace users, the `{user}` value is the
+     * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+     * field from the Directory API.
+     * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The authority to set. + * @return This builder for chaining. + */ + public Builder setAuthority(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authority_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The user who authorized the creation of the
+     * subscription.
+     *
+     * Format: `users/{user}`
+     *
+     * For Google Workspace users, the `{user}` value is the
+     * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+     * field from the Directory API.
+     * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthority() { + authority_ = getDefaultInstance().getAuthority(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The user who authorized the creation of the
+     * subscription.
+     *
+     * Format: `users/{user}`
+     *
+     * For Google Workspace users, the `{user}` value is the
+     * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+     * field from the Directory API.
+     * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authority to set. + * @return This builder for chaining. + */ + public Builder setAuthorityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authority_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000800); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the subscription is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + 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 time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Output only. The last time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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 time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The last time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00001000); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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 time that the subscription is updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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 boolean reconciling_; + /** + * + * + *
+     * Output only. If `true`, the subscription is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. If `true`, the subscription is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If `true`, the subscription is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00002000); + reconciling_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. This checksum is computed by the server based on the value of
+     * other fields, and might be sent on update requests to ensure the client has
+     * an up-to-date value before proceeding.
+     * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. This checksum is computed by the server based on the value of
+     * other fields, and might be sent on update requests to ensure the client has
+     * an up-to-date value before proceeding.
+     * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. This checksum is computed by the server based on the value of
+     * other fields, and might be sent on update requests to ensure the client has
+     * an up-to-date value before proceeding.
+     * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. This checksum is computed by the server based on the value of
+     * other fields, and might be sent on update requests to ensure the client has
+     * an up-to-date value before proceeding.
+     * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. This checksum is computed by the server based on the value of
+     * other fields, and might be sent on update requests to ensure the client has
+     * an up-to-date value before proceeding.
+     * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00004000; + 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.apps.events.subscriptions.v1.Subscription) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.Subscription) + private static final com.google.apps.events.subscriptions.v1.Subscription DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.Subscription(); + } + + public static com.google.apps.events.subscriptions.v1.Subscription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Subscription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionName.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionName.java new file mode 100644 index 000000000000..c5dd43236602 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SubscriptionName implements ResourceName { + private static final PathTemplate SUBSCRIPTION = + PathTemplate.createWithoutUrlEncoding("subscriptions/{subscription}"); + private volatile Map fieldValuesMap; + private final String subscription; + + @Deprecated + protected SubscriptionName() { + subscription = null; + } + + private SubscriptionName(Builder builder) { + subscription = Preconditions.checkNotNull(builder.getSubscription()); + } + + public String getSubscription() { + return subscription; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SubscriptionName of(String subscription) { + return newBuilder().setSubscription(subscription).build(); + } + + public static String format(String subscription) { + return newBuilder().setSubscription(subscription).build().toString(); + } + + public static SubscriptionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SUBSCRIPTION.validatedMatch( + formattedString, "SubscriptionName.parse: formattedString not in valid format"); + return of(matchMap.get("subscription")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (SubscriptionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SUBSCRIPTION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (subscription != null) { + fieldMapBuilder.put("subscription", subscription); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SUBSCRIPTION.instantiate("subscription", subscription); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SubscriptionName that = ((SubscriptionName) o); + return Objects.equals(this.subscription, that.subscription); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(subscription); + return h; + } + + /** Builder for subscriptions/{subscription}. */ + public static class Builder { + private String subscription; + + protected Builder() {} + + public String getSubscription() { + return subscription; + } + + public Builder setSubscription(String subscription) { + this.subscription = subscription; + return this; + } + + private Builder(SubscriptionName subscriptionName) { + this.subscription = subscriptionName.subscription; + } + + public SubscriptionName build() { + return new SubscriptionName(this); + } + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionOrBuilder.java new file mode 100644 index 000000000000..034484f2e78d --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionOrBuilder.java @@ -0,0 +1,657 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscription_resource.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface SubscriptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.Subscription) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Non-empty default. The timestamp in UTC when the subscription expires.
+   * Always displayed on output, regardless of what was used on input.
+   * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Non-empty default. The timestamp in UTC when the subscription expires.
+   * Always displayed on output, regardless of what was used on input.
+   * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Non-empty default. The timestamp in UTC when the subscription expires.
+   * Always displayed on output, regardless of what was used on input.
+   * 
+ * + * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Input only. The time-to-live (TTL) or duration for the subscription. If
+   * unspecified or set to `0`, uses the maximum possible duration.
+   * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + /** + * + * + *
+   * Input only. The time-to-live (TTL) or duration for the subscription. If
+   * unspecified or set to `0`, uses the maximum possible duration.
+   * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + /** + * + * + *
+   * Input only. The time-to-live (TTL) or duration for the subscription. If
+   * unspecified or set to `0`, uses the maximum possible duration.
+   * 
+ * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
+   * Optional. Immutable. Identifier. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Optional. Immutable. Identifier. Resource name of the subscription.
+   *
+   * Format: `subscriptions/{subscription}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. System-assigned unique identifier for the subscription.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. System-assigned unique identifier for the subscription.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Required. Immutable. The Google Workspace resource that's monitored for
+   * events, formatted as the [full resource
+   * name](https://google.aip.dev/122#full-resource-names). To learn about
+   * target resources, see [Supported Google Workspace
+   * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+   *
+   * A user can only authorize your app to create one subscription for a given
+   * target resource. If your app tries to create another subscription with the
+   * same user credentials, the request returns an `ALREADY_EXISTS` error.
+   * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The targetResource. + */ + java.lang.String getTargetResource(); + /** + * + * + *
+   * Required. Immutable. The Google Workspace resource that's monitored for
+   * events, formatted as the [full resource
+   * name](https://google.aip.dev/122#full-resource-names). To learn about
+   * target resources, see [Supported Google Workspace
+   * resources](https://developers.google.com/workspace/events/guides#supported-resources).
+   *
+   * A user can only authorize your app to create one subscription for a given
+   * target resource. If your app tries to create another subscription with the
+   * same user credentials, the request returns an `ALREADY_EXISTS` error.
+   * 
+ * + * + * string target_resource = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for targetResource. + */ + com.google.protobuf.ByteString getTargetResourceBytes(); + + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the eventTypes. + */ + java.util.List getEventTypesList(); + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of eventTypes. + */ + int getEventTypesCount(); + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The eventTypes at the given index. + */ + java.lang.String getEventTypes(int index); + /** + * + * + *
+   * Required. Immutable. Unordered list. Input for creating a subscription.
+   * Otherwise, output only. One or more types of events to receive about the
+   * target resource. Formatted according to the CloudEvents specification.
+   *
+   * For a list of supported event types, see the following documentation:
+   *
+   * * [Google Chat
+   * events](https://developers.google.com/workspace/events/guides/events-chat)
+   * * [Google Meet
+   * events](https://developers.google.com/workspace/events/guides/events-meet)
+   *
+   * By default, you also receive events about the [lifecycle of your
+   * subscription](https://developers.google.com/workspace/events/guides/events-lifecycle).
+   * You don't need to specify lifecycle events for this field.
+   *
+   * If you specify an event type that doesn't exist for the target resource,
+   * the request returns an HTTP `400 Bad Request` status code.
+   * 
+ * + * + * repeated string event_types = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The bytes of the eventTypes at the given index. + */ + com.google.protobuf.ByteString getEventTypesBytes(int index); + + /** + * + * + *
+   * Optional. Options about what data to include in the event payload. Only
+   * supported for Google Chat events.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the payloadOptions field is set. + */ + boolean hasPayloadOptions(); + /** + * + * + *
+   * Optional. Options about what data to include in the event payload. Only
+   * supported for Google Chat events.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The payloadOptions. + */ + com.google.apps.events.subscriptions.v1.PayloadOptions getPayloadOptions(); + /** + * + * + *
+   * Optional. Options about what data to include in the event payload. Only
+   * supported for Google Chat events.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.PayloadOptions payload_options = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.apps.events.subscriptions.v1.PayloadOptionsOrBuilder getPayloadOptionsOrBuilder(); + + /** + * + * + *
+   * Required. Immutable. The endpoint where the subscription delivers events,
+   * such as a Pub/Sub topic.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the notificationEndpoint field is set. + */ + boolean hasNotificationEndpoint(); + /** + * + * + *
+   * Required. Immutable. The endpoint where the subscription delivers events,
+   * such as a Pub/Sub topic.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The notificationEndpoint. + */ + com.google.apps.events.subscriptions.v1.NotificationEndpoint getNotificationEndpoint(); + /** + * + * + *
+   * Required. Immutable. The endpoint where the subscription delivers events,
+   * such as a Pub/Sub topic.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.NotificationEndpoint notification_endpoint = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.apps.events.subscriptions.v1.NotificationEndpointOrBuilder + getNotificationEndpointOrBuilder(); + + /** + * + * + *
+   * Output only. The state of the subscription. Determines whether the
+   * subscription can receive events and deliver them to the notification
+   * endpoint.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The state of the subscription. Determines whether the
+   * subscription can receive events and deliver them to the notification
+   * endpoint.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.apps.events.subscriptions.v1.Subscription.State getState(); + + /** + * + * + *
+   * Output only. The error that suspended the subscription.
+   *
+   * To reactivate the subscription, resolve the error and call the
+   * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+   * method.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for suspensionReason. + */ + int getSuspensionReasonValue(); + /** + * + * + *
+   * Output only. The error that suspended the subscription.
+   *
+   * To reactivate the subscription, resolve the error and call the
+   * [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
+   * method.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription.ErrorType suspension_reason = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suspensionReason. + */ + com.google.apps.events.subscriptions.v1.Subscription.ErrorType getSuspensionReason(); + + /** + * + * + *
+   * Output only. The user who authorized the creation of the
+   * subscription.
+   *
+   * Format: `users/{user}`
+   *
+   * For Google Workspace users, the `{user}` value is the
+   * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+   * field from the Directory API.
+   * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The authority. + */ + java.lang.String getAuthority(); + /** + * + * + *
+   * Output only. The user who authorized the creation of the
+   * subscription.
+   *
+   * Format: `users/{user}`
+   *
+   * For Google Workspace users, the `{user}` value is the
+   * [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
+   * field from the Directory API.
+   * 
+ * + * + * string authority = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authority. + */ + com.google.protobuf.ByteString getAuthorityBytes(); + + /** + * + * + *
+   * Output only. The time when the subscription is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the subscription is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the subscription is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time that the subscription is updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time that the subscription is updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time that the subscription is updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. If `true`, the subscription is in the process of being
+   * updated.
+   * 
+ * + * bool reconciling = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Optional. This checksum is computed by the server based on the value of
+   * other fields, and might be sent on update requests to ensure the client has
+   * an up-to-date value before proceeding.
+   * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. This checksum is computed by the server based on the value of
+   * other fields, and might be sent on update requests to ensure the client has
+   * an up-to-date value before proceeding.
+   * 
+ * + * string etag = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + com.google.apps.events.subscriptions.v1.Subscription.ExpirationCase getExpirationCase(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionResourceProto.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionResourceProto.java new file mode 100644 index 000000000000..c4fa5f5b12e6 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionResourceProto.java @@ -0,0 +1,171 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscription_resource.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public final class SubscriptionResourceProto { + private SubscriptionResourceProto() {} + + 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_apps_events_subscriptions_v1_Subscription_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_Subscription_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_PayloadOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_PayloadOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/apps/events/subscriptions/v1/su" + + "bscription_resource.proto\022#google.apps.e" + + "vents.subscriptions.v1\032\037google/api/field" + + "_behavior.proto\032\031google/api/resource.pro" + + "to\032\036google/protobuf/duration.proto\032 goog" + + "le/protobuf/field_mask.proto\032\037google/pro" + + "tobuf/timestamp.proto\"\277\t\n\014Subscription\0226" + + "\n\013expire_time\030\r \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\007H\000\022-\n\003ttl\030\016 \001(\0132\031.google.pro" + + "tobuf.DurationB\003\340A\004H\000\022\027\n\004name\030\001 \001(\tB\t\340A\010" + + "\340A\005\340A\001\022\020\n\003uid\030\002 \001(\tB\003\340A\003\022%\n\017target_resou" + + "rce\030\004 \001(\tB\014\340A\005\340A\002\372A\003\n\001*\022\036\n\013event_types\030\005" + + " \003(\tB\t\340A\002\340A\006\340A\005\022Q\n\017payload_options\030\006 \001(\013" + + "23.google.apps.events.subscriptions.v1.P" + + "ayloadOptionsB\003\340A\001\022`\n\025notification_endpo" + + "int\030\007 \001(\01329.google.apps.events.subscript" + + "ions.v1.NotificationEndpointB\006\340A\002\340A\005\022K\n\005" + + "state\030\010 \001(\01627.google.apps.events.subscri" + + "ptions.v1.Subscription.StateB\003\340A\003\022[\n\021sus" + + "pension_reason\030\022 \001(\0162;.google.apps.event" + + "s.subscriptions.v1.Subscription.ErrorTyp" + + "eB\003\340A\003\022<\n\tauthority\030\n \001(\tB)\340A\003\372A#\n!cloud" + + "identity.googleapis.com/User\0224\n\013create_t" + + "ime\030\013 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\0224\n\013update_time\030\014 \001(\0132\032.google.protobu" + + "f.TimestampB\003\340A\003\022\030\n\013reconciling\030\017 \001(\010B\003\340" + + "A\003\022\021\n\004etag\030\021 \001(\tB\003\340A\001\"F\n\005State\022\025\n\021STATE_" + + "UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\r\n\tSUSPENDED\020\002" + + "\022\013\n\007DELETED\020\003\"\331\001\n\tErrorType\022\032\n\026ERROR_TYP" + + "E_UNSPECIFIED\020\000\022\026\n\022USER_SCOPE_REVOKED\020\001\022" + + "\024\n\020RESOURCE_DELETED\020\002\022\036\n\032USER_AUTHORIZAT" + + "ION_FAILURE\020\003\022\036\n\032ENDPOINT_PERMISSION_DEN" + + "IED\020\004\022\026\n\022ENDPOINT_NOT_FOUND\020\006\022\037\n\033ENDPOIN" + + "T_RESOURCE_EXHAUSTED\020\007\022\t\n\005OTHER\020\005:n\352Ak\n+" + + "workspaceevents.googleapis.com/Subscript" + + "ion\022\034subscriptions/{subscription}*\rsubsc" + + "riptions2\014subscriptionR\001\001B\014\n\nexpiration\"" + + "d\n\016PayloadOptions\022\035\n\020include_resource\030\001 " + + "\001(\010B\003\340A\001\0223\n\nfield_mask\030\002 \001(\0132\032.google.pr" + + "otobuf.FieldMaskB\003\340A\001\"_\n\024NotificationEnd" + + "point\022;\n\014pubsub_topic\030\001 \001(\tB#\340A\005\372A\035\n\033pub" + + "sub.googleapis.com/TopicH\000B\n\n\010endpointB\210" + + "\003\n\'com.google.apps.events.subscriptions." + + "v1B\031SubscriptionResourceProtoP\001ZScloud.g" + + "oogle.com/go/apps/events/subscriptions/a" + + "piv1/subscriptionspb;subscriptionspb\252\002#G" + + "oogle.Apps.Events.Subscriptions.V1\312\002#Goo" + + "gle\\Apps\\Events\\Subscriptions\\V1\352\002\'Googl" + + "e::Apps::Events::Subscriptions::V1\352A1\n!c" + + "loudidentity.googleapis.com/User\022\014users/" + + "{user}\352A@\n\033pubsub.googleapis.com/Topic\022!" + + "projects/{project}/topics/{topic}b\006proto" + + "3" + }; + 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.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_apps_events_subscriptions_v1_Subscription_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_apps_events_subscriptions_v1_Subscription_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_Subscription_descriptor, + new java.lang.String[] { + "ExpireTime", + "Ttl", + "Name", + "Uid", + "TargetResource", + "EventTypes", + "PayloadOptions", + "NotificationEndpoint", + "State", + "SuspensionReason", + "Authority", + "CreateTime", + "UpdateTime", + "Reconciling", + "Etag", + "Expiration", + }); + internal_static_google_apps_events_subscriptions_v1_PayloadOptions_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_apps_events_subscriptions_v1_PayloadOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_PayloadOptions_descriptor, + new java.lang.String[] { + "IncludeResource", "FieldMask", + }); + internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_NotificationEndpoint_descriptor, + new java.lang.String[] { + "PubsubTopic", "Endpoint", + }); + 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.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceProto.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceProto.java new file mode 100644 index 000000000000..0bad93d45b8f --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceProto.java @@ -0,0 +1,292 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public final class SubscriptionsServiceProto { + private SubscriptionsServiceProto() {} + + 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_apps_events_subscriptions_v1_CreateSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/apps/events/subscriptions/v1/su" + + "bscriptions_service.proto\022#google.apps.e" + + "vents.subscriptions.v1\032\034google/api/annot" + + "ations.proto\032\027google/api/client.proto\032\037g" + + "oogle/api/field_behavior.proto\032\031google/a" + + "pi/resource.proto\032?google/apps/events/su" + + "bscriptions/v1/subscription_resource.pro" + + "to\032#google/longrunning/operations.proto\032" + + "\033google/protobuf/empty.proto\032 google/pro" + + "tobuf/field_mask.proto\"\205\001\n\031CreateSubscri" + + "ptionRequest\022L\n\014subscription\030\001 \001(\01321.goo" + + "gle.apps.events.subscriptions.v1.Subscri" + + "ptionB\003\340A\002\022\032\n\rvalidate_only\030\002 \001(\010B\003\340A\001\"\251" + + "\001\n\031DeleteSubscriptionRequest\022A\n\004name\030\001 \001" + + "(\tB3\340A\002\372A-\n+workspaceevents.googleapis.c" + + "om/Subscription\022\032\n\rvalidate_only\030\002 \001(\010B\003" + + "\340A\001\022\032\n\rallow_missing\030\003 \001(\010B\003\340A\001\022\021\n\004etag\030" + + "\004 \001(\tB\003\340A\001\"[\n\026GetSubscriptionRequest\022A\n\004" + + "name\030\001 \001(\tB3\340A\002\372A-\n+workspaceevents.goog" + + "leapis.com/Subscription\"\273\001\n\031UpdateSubscr" + + "iptionRequest\022L\n\014subscription\030\001 \001(\01321.go" + + "ogle.apps.events.subscriptions.v1.Subscr" + + "iptionB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.googl" + + "e.protobuf.FieldMaskB\003\340A\001\022\032\n\rvalidate_on" + + "ly\030\003 \001(\010B\003\340A\001\"b\n\035ReactivateSubscriptionR" + + "equest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+workspacee" + + "vents.googleapis.com/Subscription\"`\n\030Lis" + + "tSubscriptionsRequest\022\026\n\tpage_size\030\001 \001(\005" + + "B\003\340A\001\022\027\n\npage_token\030\002 \001(\tB\003\340A\001\022\023\n\006filter" + + "\030\003 \001(\tB\003\340A\002\"~\n\031ListSubscriptionsResponse" + + "\022H\n\rsubscriptions\030\001 \003(\01321.google.apps.ev" + + "ents.subscriptions.v1.Subscription\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\034\n\032UpdateSubscriptio" + + "nMetadata\"\034\n\032CreateSubscriptionMetadata\"" + + "\034\n\032DeleteSubscriptionMetadata\" \n\036Reactiv" + + "ateSubscriptionMetadata2\226\017\n\024Subscription" + + "sService\022\330\001\n\022CreateSubscription\022>.google" + + ".apps.events.subscriptions.v1.CreateSubs" + + "criptionRequest\032\035.google.longrunning.Ope" + + "ration\"c\312A*\n\014Subscription\022\032CreateSubscri" + + "ptionMetadata\332A\014subscription\202\323\344\223\002!\"\021/v1/" + + "subscriptions:\014subscription\022\324\001\n\022DeleteSu" + + "bscription\022>.google.apps.events.subscrip" + + "tions.v1.DeleteSubscriptionRequest\032\035.goo" + + "gle.longrunning.Operation\"_\312A3\n\025google.p" + + "rotobuf.Empty\022\032DeleteSubscriptionMetadat" + + "a\332A\004name\202\323\344\223\002\034*\032/v1/{name=subscriptions/" + + "*}\022\254\001\n\017GetSubscription\022;.google.apps.eve" + + "nts.subscriptions.v1.GetSubscriptionRequ" + + "est\0321.google.apps.events.subscriptions.v" + + "1.Subscription\")\332A\004name\202\323\344\223\002\034\022\032/v1/{name" + + "=subscriptions/*}\022\315\001\n\021ListSubscriptions\022" + + "=.google.apps.events.subscriptions.v1.Li" + + "stSubscriptionsRequest\032>.google.apps.eve" + + "nts.subscriptions.v1.ListSubscriptionsRe" + + "sponse\"9\332A\035page_size, page_token, filter" + + "\202\323\344\223\002\023\022\021/v1/subscriptions\022\373\001\n\022UpdateSubs" + + "cription\022>.google.apps.events.subscripti" + + "ons.v1.UpdateSubscriptionRequest\032\035.googl" + + "e.longrunning.Operation\"\205\001\312A*\n\014Subscript" + + "ion\022\032UpdateSubscriptionMetadata\332A\030subscr" + + "iption,update_mask\202\323\344\223\00272\'/v1/{subscript" + + "ion.name=subscriptions/*}:\014subscription\022" + + "\345\001\n\026ReactivateSubscription\022B.google.apps" + + ".events.subscriptions.v1.ReactivateSubsc" + + "riptionRequest\032\035.google.longrunning.Oper" + + "ation\"h\312A.\n\014Subscription\022\036ReactivateSubs" + + "criptionMetadata\332A\004name\202\323\344\223\002*\"%/v1/{name" + + "=subscriptions/*}:reactivate:\001*\032\346\004\312A\036wor" + + "kspaceevents.googleapis.com\322A\301\004https://w" + + "ww.googleapis.com/auth/chat.bot,https://" + + "www.googleapis.com/auth/chat.memberships" + + ",https://www.googleapis.com/auth/chat.me" + + "mberships.readonly,https://www.googleapi" + + "s.com/auth/chat.messages,https://www.goo" + + "gleapis.com/auth/chat.messages.reactions" + + ",https://www.googleapis.com/auth/chat.me" + + "ssages.reactions.readonly,https://www.go" + + "ogleapis.com/auth/chat.messages.readonly" + + ",https://www.googleapis.com/auth/chat.sp" + + "aces,https://www.googleapis.com/auth/cha" + + "t.spaces.readonly,https://www.googleapis" + + ".com/auth/meetings.space.created,https:/" + + "/www.googleapis.com/auth/meetings.space." + + "readonlyB\221\002\n\'com.google.apps.events.subs" + + "criptions.v1B\031SubscriptionsServiceProtoP" + + "\001ZScloud.google.com/go/apps/events/subsc" + + "riptions/apiv1/subscriptionspb;subscript" + + "ionspb\252\002#Google.Apps.Events.Subscription" + + "s.V1\312\002#Google\\Apps\\Events\\Subscriptions\\" + + "V1\352\002\'Google::Apps::Events::Subscriptions" + + "::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.apps.events.subscriptions.v1.SubscriptionResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionRequest_descriptor, + new java.lang.String[] { + "Subscription", "ValidateOnly", + }); + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "AllowMissing", "Etag", + }); + internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_GetSubscriptionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_descriptor, + new java.lang.String[] { + "Subscription", "UpdateMask", "ValidateOnly", + }); + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", "Filter", + }); + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_ListSubscriptionsResponse_descriptor, + new java.lang.String[] { + "Subscriptions", "NextPageToken", + }); + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_CreateSubscriptionMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_DeleteSubscriptionMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_apps_events_subscriptions_v1_ReactivateSubscriptionMetadata_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.apps.events.subscriptions.v1.SubscriptionResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionMetadata.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionMetadata.java new file mode 100644 index 000000000000..4b520071e7c4 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionMetadata.java @@ -0,0 +1,443 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * Metadata for UpdateSubscription LRO.
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata} + */ +public final class UpdateSubscriptionMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) + UpdateSubscriptionMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSubscriptionMetadata.newBuilder() to construct. + private UpdateSubscriptionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSubscriptionMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSubscriptionMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata other = + (com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata 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.apps.events.subscriptions.v1.UpdateSubscriptionMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata 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.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + 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.apps.events.subscriptions.v1.UpdateSubscriptionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata 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.apps.events.subscriptions.v1.UpdateSubscriptionMetadata 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; + } + /** + * + * + *
+   * Metadata for UpdateSubscription LRO.
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata.class, + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionMetadata_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata build() { + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata buildPartial() { + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata result = + new com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) { + return mergeFrom( + (com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata other) { + if (other + == com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) + private static final com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata(); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSubscriptionMetadata 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.apps.events.subscriptions.v1.UpdateSubscriptionMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionMetadataOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionMetadataOrBuilder.java new file mode 100644 index 000000000000..c3707dc57957 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionMetadataOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface UpdateSubscriptionMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionRequest.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionRequest.java new file mode 100644 index 000000000000..2c28d48e78e8 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionRequest.java @@ -0,0 +1,1266 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +/** + * + * + *
+ * The request message for
+ * [SubscriptionsService.UpdateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription].
+ * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.UpdateSubscriptionRequest} + */ +public final class UpdateSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) + UpdateSubscriptionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSubscriptionRequest.newBuilder() to construct. + private UpdateSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSubscriptionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSubscriptionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.Builder.class); + } + + private int bitField0_; + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private com.google.apps.events.subscriptions.v1.Subscription subscription_; + /** + * + * + *
+   * Required. The subscription to update.
+   *
+   * The subscription's `name` field is used to identify the subscription to
+   * update.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the subscription field is set. + */ + @java.lang.Override + public boolean hasSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The subscription to update.
+   *
+   * The subscription's `name` field is used to identify the subscription to
+   * update.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The subscription. + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.Subscription getSubscription() { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } + /** + * + * + *
+   * Required. The subscription to update.
+   *
+   * The subscription's `name` field is used to identify the subscription to
+   * update.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder getSubscriptionOrBuilder() { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Required. The field to update.
+   *
+   * You can update one of the following fields in a subscription:
+   *
+   * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+   *   subscription expires.
+   * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+   * time-to-live (TTL) or duration of the
+   *   subscription.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. Required. The field to update.
+   *
+   * You can update one of the following fields in a subscription:
+   *
+   * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+   *   subscription expires.
+   * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+   * time-to-live (TTL) or duration of the
+   *   subscription.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Required. The field to update.
+   *
+   * You can update one of the following fields in a subscription:
+   *
+   * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+   *   subscription expires.
+   * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+   * time-to-live (TTL) or duration of the
+   *   subscription.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set to `true`, validates and previews the request, but doesn't
+   * update the subscription.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSubscription()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSubscription()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.apps.events.subscriptions.v1.UpdateSubscriptionRequest)) { + return super.equals(obj); + } + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest other = + (com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) obj; + + if (hasSubscription() != other.hasSubscription()) return false; + if (hasSubscription()) { + if (!getSubscription().equals(other.getSubscription())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSubscription()) { + hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getSubscription().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for
+   * [SubscriptionsService.UpdateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription].
+   * 
+ * + * Protobuf type {@code google.apps.events.subscriptions.v1.UpdateSubscriptionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.class, + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.Builder.class); + } + + // Construct using + // com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSubscriptionFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + subscription_ = null; + if (subscriptionBuilder_ != null) { + subscriptionBuilder_.dispose(); + subscriptionBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.events.subscriptions.v1.SubscriptionsServiceProto + .internal_static_google_apps_events_subscriptions_v1_UpdateSubscriptionRequest_descriptor; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest + getDefaultInstanceForType() { + return com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest build() { + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest buildPartial() { + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest result = + new com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.subscription_ = + subscriptionBuilder_ == null ? subscription_ : subscriptionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) { + return mergeFrom((com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest other) { + if (other + == com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest.getDefaultInstance()) + return this; + if (other.hasSubscription()) { + mergeSubscription(other.getSubscription()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getSubscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.apps.events.subscriptions.v1.Subscription subscription_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder> + subscriptionBuilder_; + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the subscription field is set. + */ + public boolean hasSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The subscription. + */ + public com.google.apps.events.subscriptions.v1.Subscription getSubscription() { + if (subscriptionBuilder_ == null) { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } else { + return subscriptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSubscription(com.google.apps.events.subscriptions.v1.Subscription value) { + if (subscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subscription_ = value; + } else { + subscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSubscription( + com.google.apps.events.subscriptions.v1.Subscription.Builder builderForValue) { + if (subscriptionBuilder_ == null) { + subscription_ = builderForValue.build(); + } else { + subscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSubscription(com.google.apps.events.subscriptions.v1.Subscription value) { + if (subscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && subscription_ != null + && subscription_ + != com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance()) { + getSubscriptionBuilder().mergeFrom(value); + } else { + subscription_ = value; + } + } else { + subscriptionBuilder_.mergeFrom(value); + } + if (subscription_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSubscription() { + bitField0_ = (bitField0_ & ~0x00000001); + subscription_ = null; + if (subscriptionBuilder_ != null) { + subscriptionBuilder_.dispose(); + subscriptionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.apps.events.subscriptions.v1.Subscription.Builder getSubscriptionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSubscriptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder + getSubscriptionOrBuilder() { + if (subscriptionBuilder_ != null) { + return subscriptionBuilder_.getMessageOrBuilder(); + } else { + return subscription_ == null + ? com.google.apps.events.subscriptions.v1.Subscription.getDefaultInstance() + : subscription_; + } + } + /** + * + * + *
+     * Required. The subscription to update.
+     *
+     * The subscription's `name` field is used to identify the subscription to
+     * update.
+     * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder> + getSubscriptionFieldBuilder() { + if (subscriptionBuilder_ == null) { + subscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.events.subscriptions.v1.Subscription, + com.google.apps.events.subscriptions.v1.Subscription.Builder, + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder>( + getSubscription(), getParentForChildren(), isClean()); + subscription_ = null; + } + return subscriptionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Required. The field to update.
+     *
+     * You can update one of the following fields in a subscription:
+     *
+     * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+     *   subscription expires.
+     * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+     * time-to-live (TTL) or duration of the
+     *   subscription.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * update the subscription.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * update the subscription.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to `true`, validates and previews the request, but doesn't
+     * update the subscription.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) + private static final com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest(); + } + + public static com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionRequestOrBuilder.java b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..6505b4af4299 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/java/com/google/apps/events/subscriptions/v1/UpdateSubscriptionRequestOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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/apps/events/subscriptions/v1/subscriptions_service.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.events.subscriptions.v1; + +public interface UpdateSubscriptionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.events.subscriptions.v1.UpdateSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The subscription to update.
+   *
+   * The subscription's `name` field is used to identify the subscription to
+   * update.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the subscription field is set. + */ + boolean hasSubscription(); + /** + * + * + *
+   * Required. The subscription to update.
+   *
+   * The subscription's `name` field is used to identify the subscription to
+   * update.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The subscription. + */ + com.google.apps.events.subscriptions.v1.Subscription getSubscription(); + /** + * + * + *
+   * Required. The subscription to update.
+   *
+   * The subscription's `name` field is used to identify the subscription to
+   * update.
+   * 
+ * + * + * .google.apps.events.subscriptions.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.apps.events.subscriptions.v1.SubscriptionOrBuilder getSubscriptionOrBuilder(); + + /** + * + * + *
+   * Optional. Required. The field to update.
+   *
+   * You can update one of the following fields in a subscription:
+   *
+   * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+   *   subscription expires.
+   * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+   * time-to-live (TTL) or duration of the
+   *   subscription.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Required. The field to update.
+   *
+   * You can update one of the following fields in a subscription:
+   *
+   * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+   *   subscription expires.
+   * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+   * time-to-live (TTL) or duration of the
+   *   subscription.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Required. The field to update.
+   *
+   * You can update one of the following fields in a subscription:
+   *
+   * * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
+   *   subscription expires.
+   * * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
+   * time-to-live (TTL) or duration of the
+   *   subscription.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Optional. If set to `true`, validates and previews the request, but doesn't
+   * update the subscription.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/proto/google/apps/events/subscriptions/v1/subscription_resource.proto b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/proto/google/apps/events/subscriptions/v1/subscription_resource.proto new file mode 100644 index 000000000000..b29dbf6b1653 --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/proto/google/apps/events/subscriptions/v1/subscription_resource.proto @@ -0,0 +1,292 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.apps.events.subscriptions.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Apps.Events.Subscriptions.V1"; +option go_package = "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb;subscriptionspb"; +option java_multiple_files = true; +option java_outer_classname = "SubscriptionResourceProto"; +option java_package = "com.google.apps.events.subscriptions.v1"; +option php_namespace = "Google\\Apps\\Events\\Subscriptions\\V1"; +option ruby_package = "Google::Apps::Events::Subscriptions::V1"; +option (google.api.resource_definition) = { + type: "cloudidentity.googleapis.com/User" + pattern: "users/{user}" +}; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// A subscription to receive events about a Google Workspace resource. To learn +// more about subscriptions, see the [Google Workspace Events API +// overview](https://developers.google.com/workspace/events/guides). +message Subscription { + option (google.api.resource) = { + type: "workspaceevents.googleapis.com/Subscription" + pattern: "subscriptions/{subscription}" + plural: "subscriptions" + singular: "subscription" + style: DECLARATIVE_FRIENDLY + }; + + // Possible states for the subscription. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The subscription is active and can receive and deliver events to its + // notification endpoint. + ACTIVE = 1; + + // The subscription is unable to receive events due to an error. + // To identify the error, see the + // [`suspension_reason`][google.apps.events.subscriptions.v1.Subscription.suspension_reason] + // field. + SUSPENDED = 2; + + // The subscription is deleted. + DELETED = 3; + } + + // Possible errors for a subscription. + enum ErrorType { + // Default value. This value is unused. + ERROR_TYPE_UNSPECIFIED = 0; + + // The authorizing user has revoked the grant of one or more OAuth scopes. + // To learn more about authorization for Google Workspace, see [Configure + // the OAuth consent + // screen](https://developers.google.com/workspace/guides/configure-oauth-consent#choose-scopes). + USER_SCOPE_REVOKED = 1; + + // The target resource for the subscription no longer exists. + RESOURCE_DELETED = 2; + + // The user that authorized the creation of the subscription no longer has + // access to the subscription's target resource. + USER_AUTHORIZATION_FAILURE = 3; + + // The Google Workspace application doesn't have access to deliver + // events to your subscription's notification endpoint. + ENDPOINT_PERMISSION_DENIED = 4; + + // The subscription's notification endpoint doesn't exist, or the endpoint + // can't be found in the Google Cloud project where you created the + // subscription. + ENDPOINT_NOT_FOUND = 6; + + // The subscription's notification endpoint failed to receive events due to + // insufficient quota or reaching rate limiting. + ENDPOINT_RESOURCE_EXHAUSTED = 7; + + // An unidentified error has occurred. + OTHER = 5; + } + + // The time when the subscription expires. + // + // The maximum expiration time depends on whether your subscription includes + // resource data in event payloads (specified in the + // [PayloadOptions][google.apps.events.subscriptions.v1.PayloadOptions] + // field): + // + // * If payloads omit resource data, up to 7 days. + // * If payloads include resource data, up to 4 hours. If your Google + // Workspace organization grants access to the resource through [domain-wide + // delegation](https://support.google.com/a/answer/162106), you can extend the + // subscription's expiration time to up to 24 hours. + // + // After a subscription expires, it's deleted automatically. You receive + // lifecycle events to the + // [notification_endpoint][google.apps.events.subscriptions.v1.Subscription.notification_endpoint] + // 12 hours and one hour before the subscription expires. For details, see + // [Receive and respond to lifecycle + // events](https://developers.google.com/workspace/events/guides/events-lifecycle). + // + // To prevent a subscription from expiring, you can use the + // [`UpdateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription] + // method to extend its expiration date. For details, see [Update or renew a + // subscription](https://developers.google.com/workspace/events/guides/update-subscription). + oneof expiration { + // Non-empty default. The timestamp in UTC when the subscription expires. + // Always displayed on output, regardless of what was used on input. + google.protobuf.Timestamp expire_time = 13 + [(google.api.field_behavior) = NON_EMPTY_DEFAULT]; + + // Input only. The time-to-live (TTL) or duration for the subscription. If + // unspecified or set to `0`, uses the maximum possible duration. + google.protobuf.Duration ttl = 14 + [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Optional. Immutable. Identifier. Resource name of the subscription. + // + // Format: `subscriptions/{subscription}` + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // Output only. System-assigned unique identifier for the subscription. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. The Google Workspace resource that's monitored for + // events, formatted as the [full resource + // name](https://google.aip.dev/122#full-resource-names). To learn about + // target resources, see [Supported Google Workspace + // resources](https://developers.google.com/workspace/events/guides#supported-resources). + // + // A user can only authorize your app to create one subscription for a given + // target resource. If your app tries to create another subscription with the + // same user credentials, the request returns an `ALREADY_EXISTS` error. + string target_resource = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // Required. Immutable. Unordered list. Input for creating a subscription. + // Otherwise, output only. One or more types of events to receive about the + // target resource. Formatted according to the CloudEvents specification. + // + // For a list of supported event types, see the following documentation: + // + // * [Google Chat + // events](https://developers.google.com/workspace/events/guides/events-chat) + // * [Google Meet + // events](https://developers.google.com/workspace/events/guides/events-meet) + // + // By default, you also receive events about the [lifecycle of your + // subscription](https://developers.google.com/workspace/events/guides/events-lifecycle). + // You don't need to specify lifecycle events for this field. + // + // If you specify an event type that doesn't exist for the target resource, + // the request returns an HTTP `400 Bad Request` status code. + repeated string event_types = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = UNORDERED_LIST, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Options about what data to include in the event payload. Only + // supported for Google Chat events. + PayloadOptions payload_options = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The endpoint where the subscription delivers events, + // such as a Pub/Sub topic. + NotificationEndpoint notification_endpoint = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The state of the subscription. Determines whether the + // subscription can receive events and deliver them to the notification + // endpoint. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error that suspended the subscription. + // + // To reactivate the subscription, resolve the error and call the + // [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription] + // method. + ErrorType suspension_reason = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who authorized the creation of the + // subscription. + // + // Format: `users/{user}` + // + // For Google Workspace users, the `{user}` value is the + // [`user.id`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids) + // field from the Directory API. + string authority = 10 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudidentity.googleapis.com/User" + } + ]; + + // Output only. The time when the subscription is created. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time that the subscription is updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If `true`, the subscription is in the process of being + // updated. + bool reconciling = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This checksum is computed by the server based on the value of + // other fields, and might be sent on update requests to ensure the client has + // an up-to-date value before proceeding. + string etag = 17 [(google.api.field_behavior) = OPTIONAL]; +} + +// Options about what data to include in the event payload. Only supported for +// Google Chat events. +message PayloadOptions { + // Optional. Whether the event payload includes data about the resource that + // changed. For example, for an event where a Google Chat message was created, + // whether the payload contains data about the + // [`Message`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages) + // resource. If false, the event payload only includes the name of the changed + // resource. + bool include_resource = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If `include_resource` is set to `true`, the list of fields to + // include in the event payload. Separate fields with a comma. For example, to + // include a Google Chat message's sender and create time, enter + // `message.sender,message.createTime`. If omitted, the payload includes all + // fields for the resource. + // + // If you specify a field that doesn't exist for the resource, the system + // ignores the field. + google.protobuf.FieldMask field_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The endpoint where the subscription delivers events. +message NotificationEndpoint { + oneof endpoint { + // Immutable. The Cloud Pub/Sub topic that receives events for the + // subscription. + // + // Format: `projects/{project}/topics/{topic}` + // + // + // You must create the topic in the same Google Cloud project where + // you create this subscription. + // + // When the topic receives events, the events are encoded as Cloud Pub/Sub + // messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for + // CloudEvents](https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md). + string pubsub_topic = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + } +} diff --git a/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/proto/google/apps/events/subscriptions/v1/subscriptions_service.proto b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/proto/google/apps/events/subscriptions/v1/subscriptions_service.proto new file mode 100644 index 000000000000..e019711f85ec --- /dev/null +++ b/java-workspaceevents/proto-google-cloud-workspaceevents-v1/src/main/proto/google/apps/events/subscriptions/v1/subscriptions_service.proto @@ -0,0 +1,305 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.apps.events.subscriptions.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/apps/events/subscriptions/v1/subscription_resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Apps.Events.Subscriptions.V1"; +option go_package = "cloud.google.com/go/apps/events/subscriptions/apiv1/subscriptionspb;subscriptionspb"; +option java_multiple_files = true; +option java_outer_classname = "SubscriptionsServiceProto"; +option java_package = "com.google.apps.events.subscriptions.v1"; +option php_namespace = "Google\\Apps\\Events\\Subscriptions\\V1"; +option ruby_package = "Google::Apps::Events::Subscriptions::V1"; + +// A service that manages subscriptions to Google Workspace events. +service SubscriptionsService { + option (google.api.default_host) = "workspaceevents.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/chat.bot," + "https://www.googleapis.com/auth/chat.memberships," + "https://www.googleapis.com/auth/chat.memberships.readonly," + "https://www.googleapis.com/auth/chat.messages," + "https://www.googleapis.com/auth/chat.messages.reactions," + "https://www.googleapis.com/auth/chat.messages.reactions.readonly," + "https://www.googleapis.com/auth/chat.messages.readonly," + "https://www.googleapis.com/auth/chat.spaces," + "https://www.googleapis.com/auth/chat.spaces.readonly," + "https://www.googleapis.com/auth/meetings.space.created," + "https://www.googleapis.com/auth/meetings.space.readonly"; + + // Creates a Google Workspace subscription. To learn how to use this + // method, see [Create a Google Workspace + // subscription](https://developers.google.com/workspace/events/guides/create-subscription). + rpc CreateSubscription(CreateSubscriptionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/subscriptions" + body: "subscription" + }; + option (google.api.method_signature) = "subscription"; + option (google.longrunning.operation_info) = { + response_type: "Subscription" + metadata_type: "CreateSubscriptionMetadata" + }; + } + + // Deletes a Google Workspace subscription. + // To learn how to use this method, see [Delete a Google Workspace + // subscription](https://developers.google.com/workspace/events/guides/delete-subscription). + rpc DeleteSubscription(DeleteSubscriptionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=subscriptions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteSubscriptionMetadata" + }; + } + + // Gets details about a Google Workspace subscription. To learn how to use + // this method, see [Get details about a Google Workspace + // subscription](https://developers.google.com/workspace/events/guides/get-subscription). + rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) { + option (google.api.http) = { + get: "/v1/{name=subscriptions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Google Workspace subscriptions. To learn how to use this method, see + // [List Google Workspace + // subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions). + rpc ListSubscriptions(ListSubscriptionsRequest) + returns (ListSubscriptionsResponse) { + option (google.api.http) = { + get: "/v1/subscriptions" + }; + option (google.api.method_signature) = "page_size, page_token, filter"; + } + + // Updates or renews a Google Workspace subscription. To learn how to use this + // method, see [Update or renew a Google Workspace + // subscription](https://developers.google.com/workspace/events/guides/update-subscription). + rpc UpdateSubscription(UpdateSubscriptionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{subscription.name=subscriptions/*}" + body: "subscription" + }; + option (google.api.method_signature) = "subscription,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Subscription" + metadata_type: "UpdateSubscriptionMetadata" + }; + } + + // Reactivates a suspended Google Workspace subscription. + // + // This method resets your subscription's `State` field to `ACTIVE`. Before + // you use this method, you must fix the error that suspended the + // subscription. To learn how to use this method, see [Reactivate a Google + // Workspace + // subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription). + rpc ReactivateSubscription(ReactivateSubscriptionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=subscriptions/*}:reactivate" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Subscription" + metadata_type: "ReactivateSubscriptionMetadata" + }; + } +} + +// The request message for +// [SubscriptionsService.CreateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.CreateSubscription]. +message CreateSubscriptionRequest { + // Required. The subscription resource to create. + Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set to `true`, validates and previews the request, but doesn't + // create the subscription. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [SubscriptionsService.DeleteSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.DeleteSubscription]. +message DeleteSubscriptionRequest { + // Required. Resource name of the subscription to delete. + // + // Format: `subscriptions/{subscription}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workspaceevents.googleapis.com/Subscription" + } + ]; + + // Optional. If set to `true`, validates and previews the request, but doesn't + // delete the subscription. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to `true` and the subscription isn't found, the request + // succeeds but doesn't delete the subscription. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Etag of the subscription. + // + // If present, it must match with the server's etag. Otherwise, request + // fails with the status `ABORTED`. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [SubscriptionsService.GetSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.GetSubscription]. +message GetSubscriptionRequest { + // Required. Resource name of the subscription. + // + // Format: `subscriptions/{subscription}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workspaceevents.googleapis.com/Subscription" + } + ]; +} + +// The request message for +// [SubscriptionsService.UpdateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription]. +message UpdateSubscriptionRequest { + // Required. The subscription to update. + // + // The subscription's `name` field is used to identify the subscription to + // update. + Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Required. The field to update. + // + // You can update one of the following fields in a subscription: + // + // * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the + // subscription expires. + // * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The + // time-to-live (TTL) or duration of the + // subscription. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to `true`, validates and previews the request, but doesn't + // update the subscription. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for +// [SubscriptionsService.ReactivateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]. +message ReactivateSubscriptionRequest { + // Required. Resource name of the subscription. + // + // Format: `subscriptions/{subscription}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workspaceevents.googleapis.com/Subscription" + } + ]; +} + +// The request message for +// [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions]. +message ListSubscriptionsRequest { + // Optional. The maximum number of subscriptions to return. The service might + // return fewer than this value. + // + // If unspecified or set to `0`, up to 50 subscriptions are returned. + // + // The maximum value is 100. If you specify a value more than 100, the system + // only returns 100 subscriptions. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous list subscriptions call. + // Provide this parameter to retrieve the subsequent page. + // + // When paginating, the filter value should match the call that provided the + // page token. Passing a different value might lead to unexpected results. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A query filter. + // + // You can filter subscriptions by event type (`event_types`) + // and target resource (`target_resource`). + // + // You must specify at least one event type in your query. To filter for + // multiple event types, use the `OR` operator. + // + // To filter by both event type and target resource, use the `AND` operator + // and specify the full resource name, such as + // `//chat.googleapis.com/spaces/{space}`. + // + // For example, the following queries are valid: + // + // ``` + // event_types:"google.workspace.chat.membership.v1.updated" OR + // event_types:"google.workspace.chat.message.v1.created" + // + // event_types:"google.workspace.chat.message.v1.created" AND + // target_resource="//chat.googleapis.com/spaces/{space}" + // + // ( event_types:"google.workspace.chat.membership.v1.updated" OR + // event_types:"google.workspace.chat.message.v1.created" ) AND + // target_resource="//chat.googleapis.com/spaces/{space}" + // ``` + // + // The server rejects invalid queries with an `INVALID_ARGUMENT` + // error. + string filter = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The response message for +// [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions]. +message ListSubscriptionsResponse { + // List of subscriptions. + repeated Subscription subscriptions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Metadata for UpdateSubscription LRO. +message UpdateSubscriptionMetadata {} + +// Metadata for CreateSubscription LRO. +message CreateSubscriptionMetadata {} + +// Metadata for DeleteSubscription LRO. +message DeleteSubscriptionMetadata {} + +// Metadata for ReactivateSubscription LRO. +message ReactivateSubscriptionMetadata {} diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/stub/subscriptionsservicestubsettings/getsubscription/SyncGetSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/stub/subscriptionsservicestubsettings/getsubscription/SyncGetSubscription.java new file mode 100644 index 000000000000..a6654590b706 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/stub/subscriptionsservicestubsettings/getsubscription/SyncGetSubscription.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.stub.samples; + +// [START workspaceevents_v1_generated_SubscriptionsServiceStubSettings_GetSubscription_sync] +import com.google.apps.events.subscriptions.v1.stub.SubscriptionsServiceStubSettings; +import java.time.Duration; + +public class SyncGetSubscription { + + public static void main(String[] args) throws Exception { + syncGetSubscription(); + } + + public static void syncGetSubscription() 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 + SubscriptionsServiceStubSettings.Builder subscriptionsServiceSettingsBuilder = + SubscriptionsServiceStubSettings.newBuilder(); + subscriptionsServiceSettingsBuilder + .getSubscriptionSettings() + .setRetrySettings( + subscriptionsServiceSettingsBuilder + .getSubscriptionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SubscriptionsServiceStubSettings subscriptionsServiceSettings = + subscriptionsServiceSettingsBuilder.build(); + } +} +// [END workspaceevents_v1_generated_SubscriptionsServiceStubSettings_GetSubscription_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetCredentialsProvider.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..b84d23e38300 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceSettings; +import com.google.apps.events.subscriptions.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() 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 + SubscriptionsServiceSettings subscriptionsServiceSettings = + SubscriptionsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create(subscriptionsServiceSettings); + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_Create_SetCredentialsProvider_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetCredentialsProvider1.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..1f28de0dc991 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_Create_SetCredentialsProvider1_sync] +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() 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 + SubscriptionsServiceSettings subscriptionsServiceSettings = + SubscriptionsServiceSettings.newHttpJsonBuilder().build(); + SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create(subscriptionsServiceSettings); + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_Create_SetCredentialsProvider1_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetEndpoint.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..13f63e891526 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_Create_SetEndpoint_sync] +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceSettings; +import com.google.apps.events.subscriptions.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() 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 + SubscriptionsServiceSettings subscriptionsServiceSettings = + SubscriptionsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create(subscriptionsServiceSettings); + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_Create_SetEndpoint_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/AsyncCreateSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/AsyncCreateSubscription.java new file mode 100644 index 000000000000..2d4bd83e8b40 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/AsyncCreateSubscription.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.longrunning.Operation; + +public class AsyncCreateSubscription { + + public static void main(String[] args) throws Exception { + asyncCreateSubscription(); + } + + public static void asyncCreateSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + CreateSubscriptionRequest request = + CreateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + subscriptionsServiceClient.createSubscriptionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/AsyncCreateSubscriptionLRO.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/AsyncCreateSubscriptionLRO.java new file mode 100644 index 000000000000..c52fa3d0dc63 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/AsyncCreateSubscriptionLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class AsyncCreateSubscriptionLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSubscriptionLRO(); + } + + public static void asyncCreateSubscriptionLRO() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + CreateSubscriptionRequest request = + CreateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + subscriptionsServiceClient.createSubscriptionOperationCallable().futureCall(request); + // Do something. + Subscription response = future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_LRO_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/SyncCreateSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/SyncCreateSubscription.java new file mode 100644 index 000000000000..2bc825df2c81 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/SyncCreateSubscription.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_sync] +import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncCreateSubscription { + + public static void main(String[] args) throws Exception { + syncCreateSubscription(); + } + + public static void syncCreateSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + CreateSubscriptionRequest request = + CreateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setValidateOnly(true) + .build(); + Subscription response = subscriptionsServiceClient.createSubscriptionAsync(request).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/SyncCreateSubscriptionSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/SyncCreateSubscriptionSubscription.java new file mode 100644 index 000000000000..74c2ef7f0e3b --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/createsubscription/SyncCreateSubscriptionSubscription.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_Subscription_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncCreateSubscriptionSubscription { + + public static void main(String[] args) throws Exception { + syncCreateSubscriptionSubscription(); + } + + public static void syncCreateSubscriptionSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + Subscription subscription = Subscription.newBuilder().build(); + Subscription response = + subscriptionsServiceClient.createSubscriptionAsync(subscription).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_CreateSubscription_Subscription_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/AsyncDeleteSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/AsyncDeleteSubscription.java new file mode 100644 index 000000000000..0b4a5cd2f9a9 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/AsyncDeleteSubscription.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteSubscription { + + public static void main(String[] args) throws Exception { + asyncDeleteSubscription(); + } + + public static void asyncDeleteSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setValidateOnly(true) + .setAllowMissing(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = + subscriptionsServiceClient.deleteSubscriptionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/AsyncDeleteSubscriptionLRO.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/AsyncDeleteSubscriptionLRO.java new file mode 100644 index 000000000000..894fe0502152 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/AsyncDeleteSubscriptionLRO.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteSubscriptionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteSubscriptionLRO(); + } + + public static void asyncDeleteSubscriptionLRO() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setValidateOnly(true) + .setAllowMissing(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + subscriptionsServiceClient.deleteSubscriptionOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_LRO_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscription.java new file mode 100644 index 000000000000..f9c95b1526e3 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscription.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_sync] +import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSubscription { + + public static void main(String[] args) throws Exception { + syncDeleteSubscription(); + } + + public static void syncDeleteSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .setValidateOnly(true) + .setAllowMissing(true) + .setEtag("etag3123477") + .build(); + subscriptionsServiceClient.deleteSubscriptionAsync(request).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscriptionString.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscriptionString.java new file mode 100644 index 000000000000..9c246a18b9c6 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscriptionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_String_sync] +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSubscriptionString { + + public static void main(String[] args) throws Exception { + syncDeleteSubscriptionString(); + } + + public static void syncDeleteSubscriptionString() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + String name = SubscriptionName.of("[SUBSCRIPTION]").toString(); + subscriptionsServiceClient.deleteSubscriptionAsync(name).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_String_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java new file mode 100644 index 000000000000..2933ea8364b4 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_Subscriptionname_sync] +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSubscriptionSubscriptionname { + + public static void main(String[] args) throws Exception { + syncDeleteSubscriptionSubscriptionname(); + } + + public static void syncDeleteSubscriptionSubscriptionname() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + subscriptionsServiceClient.deleteSubscriptionAsync(name).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_DeleteSubscription_Subscriptionname_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/AsyncGetSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/AsyncGetSubscription.java new file mode 100644 index 000000000000..33e60d750356 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/AsyncGetSubscription.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_GetSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class AsyncGetSubscription { + + public static void main(String[] args) throws Exception { + asyncGetSubscription(); + } + + public static void asyncGetSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + GetSubscriptionRequest request = + GetSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .build(); + ApiFuture future = + subscriptionsServiceClient.getSubscriptionCallable().futureCall(request); + // Do something. + Subscription response = future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_GetSubscription_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscription.java new file mode 100644 index 000000000000..1caafd79871c --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscription.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_GetSubscription_sync] +import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncGetSubscription { + + public static void main(String[] args) throws Exception { + syncGetSubscription(); + } + + public static void syncGetSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + GetSubscriptionRequest request = + GetSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .build(); + Subscription response = subscriptionsServiceClient.getSubscription(request); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_GetSubscription_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscriptionString.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscriptionString.java new file mode 100644 index 000000000000..25b271ef543b --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscriptionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_GetSubscription_String_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncGetSubscriptionString { + + public static void main(String[] args) throws Exception { + syncGetSubscriptionString(); + } + + public static void syncGetSubscriptionString() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + String name = SubscriptionName.of("[SUBSCRIPTION]").toString(); + Subscription response = subscriptionsServiceClient.getSubscription(name); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_GetSubscription_String_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscriptionSubscriptionname.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscriptionSubscriptionname.java new file mode 100644 index 000000000000..f3c6e9a68964 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/getsubscription/SyncGetSubscriptionSubscriptionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_GetSubscription_Subscriptionname_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncGetSubscriptionSubscriptionname { + + public static void main(String[] args) throws Exception { + syncGetSubscriptionSubscriptionname(); + } + + public static void syncGetSubscriptionSubscriptionname() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + Subscription response = subscriptionsServiceClient.getSubscription(name); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_GetSubscription_Subscriptionname_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/AsyncListSubscriptions.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/AsyncListSubscriptions.java new file mode 100644 index 000000000000..f55c83191274 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/AsyncListSubscriptions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_async] +import com.google.api.core.ApiFuture; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class AsyncListSubscriptions { + + public static void main(String[] args) throws Exception { + asyncListSubscriptions(); + } + + public static void asyncListSubscriptions() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + ListSubscriptionsRequest request = + ListSubscriptionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + subscriptionsServiceClient.listSubscriptionsPagedCallable().futureCall(request); + // Do something. + for (Subscription element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/AsyncListSubscriptionsPaged.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/AsyncListSubscriptionsPaged.java new file mode 100644 index 000000000000..ae8de6009d43 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/AsyncListSubscriptionsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_Paged_async] +import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest; +import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.common.base.Strings; + +public class AsyncListSubscriptionsPaged { + + public static void main(String[] args) throws Exception { + asyncListSubscriptionsPaged(); + } + + public static void asyncListSubscriptionsPaged() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + ListSubscriptionsRequest request = + ListSubscriptionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListSubscriptionsResponse response = + subscriptionsServiceClient.listSubscriptionsCallable().call(request); + for (Subscription element : response.getSubscriptionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_Paged_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/SyncListSubscriptions.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/SyncListSubscriptions.java new file mode 100644 index 000000000000..bc37ad04a176 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/SyncListSubscriptions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_sync] +import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncListSubscriptions { + + public static void main(String[] args) throws Exception { + syncListSubscriptions(); + } + + public static void syncListSubscriptions() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + ListSubscriptionsRequest request = + ListSubscriptionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Subscription element : + subscriptionsServiceClient.listSubscriptions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/SyncListSubscriptionsIntStringString.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/SyncListSubscriptionsIntStringString.java new file mode 100644 index 000000000000..95c8c15da4ee --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/listsubscriptions/SyncListSubscriptionsIntStringString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_IntStringString_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncListSubscriptionsIntStringString { + + public static void main(String[] args) throws Exception { + syncListSubscriptionsIntStringString(); + } + + public static void syncListSubscriptionsIntStringString() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + int pageSize = 883849137; + String pageToken = "pageToken873572522"; + String filter = "filter-1274492040"; + for (Subscription element : + subscriptionsServiceClient.listSubscriptions(pageSize, pageToken, filter).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ListSubscriptions_IntStringString_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/AsyncReactivateSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/AsyncReactivateSubscription.java new file mode 100644 index 000000000000..ff3c660e6a69 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/AsyncReactivateSubscription.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.longrunning.Operation; + +public class AsyncReactivateSubscription { + + public static void main(String[] args) throws Exception { + asyncReactivateSubscription(); + } + + public static void asyncReactivateSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + ReactivateSubscriptionRequest request = + ReactivateSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .build(); + ApiFuture future = + subscriptionsServiceClient.reactivateSubscriptionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/AsyncReactivateSubscriptionLRO.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/AsyncReactivateSubscriptionLRO.java new file mode 100644 index 000000000000..9ab1d09400e3 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/AsyncReactivateSubscriptionLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class AsyncReactivateSubscriptionLRO { + + public static void main(String[] args) throws Exception { + asyncReactivateSubscriptionLRO(); + } + + public static void asyncReactivateSubscriptionLRO() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + ReactivateSubscriptionRequest request = + ReactivateSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .build(); + OperationFuture future = + subscriptionsServiceClient.reactivateSubscriptionOperationCallable().futureCall(request); + // Do something. + Subscription response = future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_LRO_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscription.java new file mode 100644 index 000000000000..2478abb208f2 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscription.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_sync] +import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncReactivateSubscription { + + public static void main(String[] args) throws Exception { + syncReactivateSubscription(); + } + + public static void syncReactivateSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + ReactivateSubscriptionRequest request = + ReactivateSubscriptionRequest.newBuilder() + .setName(SubscriptionName.of("[SUBSCRIPTION]").toString()) + .build(); + Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(request).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscriptionString.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscriptionString.java new file mode 100644 index 000000000000..887a03a424bb --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscriptionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_String_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncReactivateSubscriptionString { + + public static void main(String[] args) throws Exception { + syncReactivateSubscriptionString(); + } + + public static void syncReactivateSubscriptionString() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + String name = SubscriptionName.of("[SUBSCRIPTION]").toString(); + Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(name).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_String_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscriptionSubscriptionname.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscriptionSubscriptionname.java new file mode 100644 index 000000000000..780c9e9e5280 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/reactivatesubscription/SyncReactivateSubscriptionSubscriptionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_Subscriptionname_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionName; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; + +public class SyncReactivateSubscriptionSubscriptionname { + + public static void main(String[] args) throws Exception { + syncReactivateSubscriptionSubscriptionname(); + } + + public static void syncReactivateSubscriptionSubscriptionname() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]"); + Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(name).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_ReactivateSubscription_Subscriptionname_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/AsyncUpdateSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/AsyncUpdateSubscription.java new file mode 100644 index 000000000000..d8f48dfb3012 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/AsyncUpdateSubscription.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_async] +import com.google.api.core.ApiFuture; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSubscription { + + public static void main(String[] args) throws Exception { + asyncUpdateSubscription(); + } + + public static void asyncUpdateSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + UpdateSubscriptionRequest request = + UpdateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + subscriptionsServiceClient.updateSubscriptionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/AsyncUpdateSubscriptionLRO.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/AsyncUpdateSubscriptionLRO.java new file mode 100644 index 000000000000..8dc21d4f114c --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/AsyncUpdateSubscriptionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSubscriptionLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateSubscriptionLRO(); + } + + public static void asyncUpdateSubscriptionLRO() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + UpdateSubscriptionRequest request = + UpdateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + subscriptionsServiceClient.updateSubscriptionOperationCallable().futureCall(request); + // Do something. + Subscription response = future.get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_LRO_async] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/SyncUpdateSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/SyncUpdateSubscription.java new file mode 100644 index 000000000000..bad75037b834 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/SyncUpdateSubscription.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSubscription { + + public static void main(String[] args) throws Exception { + syncUpdateSubscription(); + } + + public static void syncUpdateSubscription() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + UpdateSubscriptionRequest request = + UpdateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + Subscription response = subscriptionsServiceClient.updateSubscriptionAsync(request).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/SyncUpdateSubscriptionSubscriptionFieldmask.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/SyncUpdateSubscriptionSubscriptionFieldmask.java new file mode 100644 index 000000000000..639c94ab432f --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservice/updatesubscription/SyncUpdateSubscriptionSubscriptionFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_SubscriptionFieldmask_sync] +import com.google.apps.events.subscriptions.v1.Subscription; +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSubscriptionSubscriptionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSubscriptionSubscriptionFieldmask(); + } + + public static void syncUpdateSubscriptionSubscriptionFieldmask() 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 (SubscriptionsServiceClient subscriptionsServiceClient = + SubscriptionsServiceClient.create()) { + Subscription subscription = Subscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Subscription response = + subscriptionsServiceClient.updateSubscriptionAsync(subscription, updateMask).get(); + } + } +} +// [END workspaceevents_v1_generated_SubscriptionsService_UpdateSubscription_SubscriptionFieldmask_sync] diff --git a/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservicesettings/getsubscription/SyncGetSubscription.java b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservicesettings/getsubscription/SyncGetSubscription.java new file mode 100644 index 000000000000..fb9a43809049 --- /dev/null +++ b/java-workspaceevents/samples/snippets/generated/com/google/apps/events/subscriptions/v1/subscriptionsservicesettings/getsubscription/SyncGetSubscription.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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.apps.events.subscriptions.v1.samples; + +// [START workspaceevents_v1_generated_SubscriptionsServiceSettings_GetSubscription_sync] +import com.google.apps.events.subscriptions.v1.SubscriptionsServiceSettings; +import java.time.Duration; + +public class SyncGetSubscription { + + public static void main(String[] args) throws Exception { + syncGetSubscription(); + } + + public static void syncGetSubscription() 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 + SubscriptionsServiceSettings.Builder subscriptionsServiceSettingsBuilder = + SubscriptionsServiceSettings.newBuilder(); + subscriptionsServiceSettingsBuilder + .getSubscriptionSettings() + .setRetrySettings( + subscriptionsServiceSettingsBuilder + .getSubscriptionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SubscriptionsServiceSettings subscriptionsServiceSettings = + subscriptionsServiceSettingsBuilder.build(); + } +} +// [END workspaceevents_v1_generated_SubscriptionsServiceSettings_GetSubscription_sync] diff --git a/pom.xml b/pom.xml index 5145d4442e1a..48845fcf2838 100644 --- a/pom.xml +++ b/pom.xml @@ -187,6 +187,7 @@ java-websecurityscanner java-workflow-executions java-workflows + java-workspaceevents java-workstations diff --git a/versions.txt b/versions.txt index 074faf95e39b..24cf2f03feee 100644 --- a/versions.txt +++ b/versions.txt @@ -730,6 +730,9 @@ proto-google-cloud-securityposture-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-securityposture-v1:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-securitycenter-v2:2.44.0:2.45.0-SNAPSHOT grpc-google-cloud-securitycenter-v2:2.44.0:2.45.0-SNAPSHOT +google-cloud-workspaceevents:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-workspaceevents-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-workspaceevents-v1:0.0.0:0.0.1-SNAPSHOT google-cloud-apphub:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-apphub-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-apphub-v1:0.0.0:0.0.1-SNAPSHOT