diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index a7c52b65d3c1..d740da2b698e 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -294,6 +294,13 @@ pom import + + com.google.cloud + google-cloud-chat-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-build-bom diff --git a/java-chat/.OwlBot.yaml b/java-chat/.OwlBot.yaml new file mode 100644 index 000000000000..f4f545339680 --- /dev/null +++ b/java-chat/.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-chat/grpc-google-.*/src" +- "/java-chat/proto-google-.*/src" +- "/java-chat/google-.*/src" +- "/java-chat/samples/snippets/generated" + +deep-preserve-regex: +- "/java-chat/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/chat/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-chat/$1/proto-google-cloud-chat-$1/src" +- source: "/google/chat/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-chat/$1/grpc-google-cloud-chat-$1/src" +- source: "/google/chat/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-chat/$1/google-cloud-chat/src" +- source: "/google/chat/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-chat/$1/samples/snippets/generated" + + +api-name: chat \ No newline at end of file diff --git a/java-chat/.repo-metadata.json b/java-chat/.repo-metadata.json new file mode 100644 index 000000000000..bdac81ddc5d0 --- /dev/null +++ b/java-chat/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_shortname": "chat", + "name_pretty": "Google Chat API", + "product_documentation": "https://developers.google.com/chat/concepts", + "api_description": "The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-chat/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/java-chat", + "repo_short": "java-chat", + "distribution_name": "com.google.cloud:google-cloud-chat", + "api_id": "chat.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true, + "rest_documentation": "https://developers.google.com/chat/api/reference/rest" +} \ No newline at end of file diff --git a/java-chat/README.md b/java-chat/README.md new file mode 100644 index 000000000000..06bdf584620f --- /dev/null +++ b/java-chat/README.md @@ -0,0 +1,225 @@ +# Google Google Chat API Client for Java + +Java idiomatic client for [Google Chat 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-chat + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-chat + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-chat:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-chat" % "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 Chat API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Google Chat API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Google Chat API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Google Chat 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-chat` library. See the [Quickstart](#quickstart) section +to add `google-cloud-chat` as a dependency in your code. + +## About Google Chat API + + +[Google Chat API][product-docs] The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages. + +See the [Google Chat API client library docs][javadocs] to learn how to +use this Google Chat API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Google Chat 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/chat/concepts +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-chat/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-chat/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-chat.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-chat/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-chat/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-chat/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-chat/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=chat.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-chat/google-cloud-chat-bom/pom.xml b/java-chat/google-cloud-chat-bom/pom.xml new file mode 100644 index 000000000000..785f3a30628c --- /dev/null +++ b/java-chat/google-cloud-chat-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-chat-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 Chat API BOM + + BOM for Google Chat API + + + + true + + + + + + com.google.cloud + google-cloud-chat + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-chat-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-chat-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-chat/google-cloud-chat/pom.xml b/java-chat/google-cloud-chat/pom.xml new file mode 100644 index 000000000000..2bf7759d0e0f --- /dev/null +++ b/java-chat/google-cloud-chat/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-chat + 0.0.1-SNAPSHOT + jar + Google Google Chat API + Google Chat API The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages. + + com.google.cloud + google-cloud-chat-parent + 0.0.1-SNAPSHOT + + + google-cloud-chat + + + + 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-chat-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-chat-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-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceClient.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceClient.java new file mode 100644 index 000000000000..95442e69facf --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceClient.java @@ -0,0 +1,3986 @@ +/* + * 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.chat.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.chat.v1.stub.ChatServiceStub; +import com.google.chat.v1.stub.ChatServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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: Enables developers to build Chat apps and integrations on Google Chat + * Platform. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+ *   SpaceName parent = SpaceName.of("[SPACE]");
+ *   Message message = Message.newBuilder().build();
+ *   String messageId = "messageId-1440013438";
+ *   Message response = chatServiceClient.createMessage(parent, message, messageId);
+ * }
+ * }
+ * + *

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

CreateMessage

Creates a message in a Google Chat space. For an example, see [Create a message](https://developers.google.com/chat/api/guides/v1/messages/create). + *

Calling this method requires [authentication](https://developers.google.com/chat/api/guides/auth) and supports the following authentication types: + *

- For text messages, user authentication or app authentication are supported. - For card messages, only app authentication is supported. (Only Chat apps can create card messages.)

+ *

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

+ *
    + *
  • createMessage(CreateMessageRequest request) + *

+ *

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

+ *
    + *
  • createMessage(SpaceName parent, Message message, String messageId) + *

  • createMessage(String parent, Message message, String messageId) + *

+ *

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

+ *
    + *
  • createMessageCallable() + *

+ *

ListMessages

Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • listMessages(ListMessagesRequest request) + *

+ *

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

+ *
    + *
  • listMessages(SpaceName parent) + *

  • listMessages(String parent) + *

+ *

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

+ *
    + *
  • listMessagesPagedCallable() + *

  • listMessagesCallable() + *

+ *

ListMemberships

Lists memberships in a space. For an example, see [List memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing memberships with [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in spaces that the authenticated user has access to. + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • listMemberships(ListMembershipsRequest request) + *

+ *

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

+ *
    + *
  • listMemberships(SpaceName parent) + *

  • listMemberships(String parent) + *

+ *

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

+ *
    + *
  • listMembershipsPagedCallable() + *

  • listMembershipsCallable() + *

+ *

GetMembership

Returns details about a membership. For an example, see [Get a membership](https://developers.google.com/chat/api/guides/v1/members/get). + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • getMembership(GetMembershipRequest request) + *

+ *

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

+ *
    + *
  • getMembership(MembershipName name) + *

  • getMembership(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.

+ *
    + *
  • getMembershipCallable() + *

+ *

GetMessage

Returns details about a message. For an example, see [Read a message](https://developers.google.com/chat/api/guides/v1/messages/get). + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). + *

Note: Might return a message from a blocked member or space.

+ *

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

+ *
    + *
  • getMessage(GetMessageRequest request) + *

+ *

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

+ *
    + *
  • getMessage(MessageName name) + *

  • getMessage(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.

+ *
    + *
  • getMessageCallable() + *

+ *

UpdateMessage

Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only update messages created by the calling Chat app.

+ *

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

+ *
    + *
  • updateMessage(UpdateMessageRequest request) + *

+ *

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

+ *
    + *
  • updateMessage(Message message, 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.

+ *
    + *
  • updateMessageCallable() + *

+ *

DeleteMessage

Deletes a message. For an example, see [Delete a message](https://developers.google.com/chat/api/guides/v1/messages/delete). + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only delete messages created by the calling Chat app.

+ *

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

+ *
    + *
  • deleteMessage(DeleteMessageRequest request) + *

+ *

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

+ *
    + *
  • deleteMessage(MessageName name) + *

  • deleteMessage(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.

+ *
    + *
  • deleteMessageCallable() + *

+ *

GetAttachment

Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, see [Get a message attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).

+ *

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

+ *
    + *
  • getAttachment(GetAttachmentRequest request) + *

+ *

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

+ *
    + *
  • getAttachment(AttachmentName name) + *

  • getAttachment(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.

+ *
    + *
  • getAttachmentCallable() + *

+ *

UploadAttachment

Uploads an attachment. For an example, see [Upload media as a file attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). + *

You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).

+ *

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

+ *
    + *
  • uploadAttachment(UploadAttachmentRequest request) + *

+ *

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

+ *
    + *
  • uploadAttachmentCallable() + *

+ *

ListSpaces

Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). + *

Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.

+ *

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

+ *
    + *
  • listSpaces(ListSpacesRequest request) + *

+ *

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

+ *
    + *
  • listSpaces() + *

+ *

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

+ *
    + *
  • listSpacesPagedCallable() + *

  • listSpacesCallable() + *

+ *

GetSpace

Returns details about a space. For an example, see [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • getSpace(GetSpaceRequest request) + *

+ *

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

+ *
    + *
  • getSpace(SpaceName name) + *

  • getSpace(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.

+ *
    + *
  • getSpaceCallable() + *

+ *

CreateSpace

Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/chat/api/guides/v1/spaces/create). + *

If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • createSpace(CreateSpaceRequest request) + *

+ *

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

+ *
    + *
  • createSpace(Space space) + *

+ *

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

+ *
    + *
  • createSpaceCallable() + *

+ *

SetUpSpace

Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). + *

To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or `users/123456789`. + *

For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. + *

To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. + *

To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). + *

If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. + *

Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • setUpSpace(SetUpSpaceRequest request) + *

+ *

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

+ *
    + *
  • setUpSpaceCallable() + *

+ *

UpdateSpace

Updates a space. For an example, see [Update a space](https://developers.google.com/chat/api/guides/v1/spaces/update). + *

If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • updateSpace(UpdateSpaceRequest request) + *

+ *

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

+ *
    + *
  • updateSpace(Space space, 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.

+ *
    + *
  • updateSpaceCallable() + *

+ *

DeleteSpace

Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see [Delete a space](https://developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) from a user who has permission to delete the space.

+ *

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

+ *
    + *
  • deleteSpace(DeleteSpaceRequest request) + *

+ *

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

+ *
    + *
  • deleteSpace(SpaceName name) + *

  • deleteSpace(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.

+ *
    + *
  • deleteSpaceCallable() + *

+ *

CompleteImportSpace

Completes the [import process](https://developers.google.com/chat/api/guides/import-data) for the specified space and makes it visible to users. Requires app authentication and domain-wide delegation. For more information, see [Authorize Google Chat apps to import data](https://developers.google.com/chat/api/guides/authorize-import).

+ *

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

+ *
    + *
  • completeImportSpace(CompleteImportSpaceRequest request) + *

+ *

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

+ *
    + *
  • completeImportSpaceCallable() + *

+ *

FindDirectMessage

Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). + *

With [user authentication](https://developers.google.com/chat/api/guides/auth/users), returns the direct message space between the specified user and the authenticated user. + *

With [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns the direct message space between the specified user and the calling Chat app. + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).

+ *

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

+ *
    + *
  • findDirectMessage(FindDirectMessageRequest request) + *

+ *

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

+ *
    + *
  • findDirectMessageCallable() + *

+ *

CreateMembership

Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + *

To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: + *

- To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. + *

- To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or `users/123456789`.

+ *

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

+ *
    + *
  • createMembership(CreateMembershipRequest request) + *

+ *

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

+ *
    + *
  • createMembership(SpaceName parent, Membership membership) + *

  • createMembership(String parent, Membership membership) + *

+ *

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

+ *
    + *
  • createMembershipCallable() + *

+ *

DeleteMembership

Deletes a membership. For an example, see [Delete a membership](https://developers.google.com/chat/api/guides/v1/members/delete). + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • deleteMembership(DeleteMembershipRequest request) + *

+ *

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

+ *
    + *
  • deleteMembership(MembershipName name) + *

  • deleteMembership(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.

+ *
    + *
  • deleteMembershipCallable() + *

+ *

CreateReaction

Creates a reaction and adds it to a message. For an example, see [Create a reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). Only unicode emoji are supported.

+ *

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

+ *
    + *
  • createReaction(CreateReactionRequest request) + *

+ *

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

+ *
    + *
  • createReaction(MessageName parent, Reaction reaction) + *

  • createReaction(String parent, Reaction reaction) + *

+ *

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

+ *
    + *
  • createReactionCallable() + *

+ *

ListReactions

Lists reactions to a message. For an example, see [List reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • listReactions(ListReactionsRequest request) + *

+ *

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

+ *
    + *
  • listReactions(MessageName parent) + *

  • listReactions(String parent) + *

+ *

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

+ *
    + *
  • listReactionsPagedCallable() + *

  • listReactionsCallable() + *

+ *

DeleteReaction

Deletes a reaction to a message. For an example, see [Delete a reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).

+ *

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

+ *
    + *
  • deleteReaction(DeleteReactionRequest request) + *

+ *

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

+ *
    + *
  • deleteReaction(ReactionName name) + *

  • deleteReaction(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.

+ *
    + *
  • deleteReactionCallable() + *

+ *
+ * + *

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 ChatServiceSettings 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
+ * ChatServiceSettings chatServiceSettings =
+ *     ChatServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ChatServiceClient chatServiceClient = ChatServiceClient.create(chatServiceSettings);
+ * }
+ * + *

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
+ * ChatServiceSettings chatServiceSettings =
+ *     ChatServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ChatServiceClient chatServiceClient = ChatServiceClient.create(chatServiceSettings);
+ * }
+ * + *

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
+ * ChatServiceSettings chatServiceSettings = ChatServiceSettings.newHttpJsonBuilder().build();
+ * ChatServiceClient chatServiceClient = ChatServiceClient.create(chatServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ChatServiceClient implements BackgroundResource { + private final ChatServiceSettings settings; + private final ChatServiceStub stub; + + /** Constructs an instance of ChatServiceClient with default settings. */ + public static final ChatServiceClient create() throws IOException { + return create(ChatServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ChatServiceClient, 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 ChatServiceClient create(ChatServiceSettings settings) throws IOException { + return new ChatServiceClient(settings); + } + + /** + * Constructs an instance of ChatServiceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ChatServiceSettings). + */ + public static final ChatServiceClient create(ChatServiceStub stub) { + return new ChatServiceClient(stub); + } + + /** + * Constructs an instance of ChatServiceClient, 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 ChatServiceClient(ChatServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ChatServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ChatServiceClient(ChatServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ChatServiceSettings getSettings() { + return settings; + } + + public ChatServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a message in a Google Chat space. For an example, see [Create a + * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * + *

Calling this method requires + * [authentication](https://developers.google.com/chat/api/guides/auth) and supports the following + * authentication types: + * + *

- For text messages, user authentication or app authentication are supported. - For card + * messages, only app authentication is supported. (Only Chat apps can create card messages.) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SpaceName parent = SpaceName.of("[SPACE]");
+   *   Message message = Message.newBuilder().build();
+   *   String messageId = "messageId-1440013438";
+   *   Message response = chatServiceClient.createMessage(parent, message, messageId);
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space in which to create a message. + *

Format: `spaces/{space}` + * @param message Required. Message body. + * @param messageId Optional. A custom ID for a message. Lets Chat apps get, update, or delete a + * message without needing to store the system-assigned ID in the message's resource name + * (represented in the message `name` field). + *

The value for this field must meet the following requirements: + *

+ *

For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Message createMessage(SpaceName parent, Message message, String messageId) { + CreateMessageRequest request = + CreateMessageRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setMessage(message) + .setMessageId(messageId) + .build(); + return createMessage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a message in a Google Chat space. For an example, see [Create a + * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * + *

Calling this method requires + * [authentication](https://developers.google.com/chat/api/guides/auth) and supports the following + * authentication types: + * + *

- For text messages, user authentication or app authentication are supported. - For card + * messages, only app authentication is supported. (Only Chat apps can create card messages.) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String parent = SpaceName.of("[SPACE]").toString();
+   *   Message message = Message.newBuilder().build();
+   *   String messageId = "messageId-1440013438";
+   *   Message response = chatServiceClient.createMessage(parent, message, messageId);
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space in which to create a message. + *

Format: `spaces/{space}` + * @param message Required. Message body. + * @param messageId Optional. A custom ID for a message. Lets Chat apps get, update, or delete a + * message without needing to store the system-assigned ID in the message's resource name + * (represented in the message `name` field). + *

The value for this field must meet the following requirements: + *

+ *

For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Message createMessage(String parent, Message message, String messageId) { + CreateMessageRequest request = + CreateMessageRequest.newBuilder() + .setParent(parent) + .setMessage(message) + .setMessageId(messageId) + .build(); + return createMessage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a message in a Google Chat space. For an example, see [Create a + * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * + *

Calling this method requires + * [authentication](https://developers.google.com/chat/api/guides/auth) and supports the following + * authentication types: + * + *

- For text messages, user authentication or app authentication are supported. - For card + * messages, only app authentication is supported. (Only Chat apps can create card messages.) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateMessageRequest request =
+   *       CreateMessageRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setMessage(Message.newBuilder().build())
+   *           .setThreadKey("threadKey-1562254347")
+   *           .setRequestId("requestId693933066")
+   *           .setMessageId("messageId-1440013438")
+   *           .build();
+   *   Message response = chatServiceClient.createMessage(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 Message createMessage(CreateMessageRequest request) { + return createMessageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a message in a Google Chat space. For an example, see [Create a + * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * + *

Calling this method requires + * [authentication](https://developers.google.com/chat/api/guides/auth) and supports the following + * authentication types: + * + *

- For text messages, user authentication or app authentication are supported. - For card + * messages, only app authentication is supported. (Only Chat apps can create card messages.) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateMessageRequest request =
+   *       CreateMessageRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setMessage(Message.newBuilder().build())
+   *           .setThreadKey("threadKey-1562254347")
+   *           .setRequestId("requestId693933066")
+   *           .setMessageId("messageId-1440013438")
+   *           .build();
+   *   ApiFuture future = chatServiceClient.createMessageCallable().futureCall(request);
+   *   // Do something.
+   *   Message response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createMessageCallable() { + return stub.createMessageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists messages in a space that the caller is a member of, including messages from blocked + * members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). + * Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SpaceName parent = SpaceName.of("[SPACE]");
+   *   for (Message element : chatServiceClient.listMessages(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space to list messages from. + *

Format: `spaces/{space}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMessagesPagedResponse listMessages(SpaceName parent) { + ListMessagesRequest request = + ListMessagesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listMessages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists messages in a space that the caller is a member of, including messages from blocked + * members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). + * Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String parent = SpaceName.of("[SPACE]").toString();
+   *   for (Message element : chatServiceClient.listMessages(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space to list messages from. + *

Format: `spaces/{space}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMessagesPagedResponse listMessages(String parent) { + ListMessagesRequest request = ListMessagesRequest.newBuilder().setParent(parent).build(); + return listMessages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists messages in a space that the caller is a member of, including messages from blocked + * members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). + * Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListMessagesRequest request =
+   *       ListMessagesRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   for (Message element : chatServiceClient.listMessages(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 ListMessagesPagedResponse listMessages(ListMessagesRequest request) { + return listMessagesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists messages in a space that the caller is a member of, including messages from blocked + * members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). + * Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListMessagesRequest request =
+   *       ListMessagesRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   ApiFuture future = chatServiceClient.listMessagesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Message element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listMessagesPagedCallable() { + return stub.listMessagesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists messages in a space that the caller is a member of, including messages from blocked + * members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). + * Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListMessagesRequest request =
+   *       ListMessagesRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   while (true) {
+   *     ListMessagesResponse response = chatServiceClient.listMessagesCallable().call(request);
+   *     for (Message element : response.getMessagesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listMessagesCallable() { + return stub.listMessagesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists memberships in a space. For an example, see [List + * memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing + * memberships with [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists + * memberships in spaces that the Chat app has access to, but excludes Chat app memberships, + * including its own. Listing memberships with [User + * authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in + * spaces that the authenticated user has access to. + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SpaceName parent = SpaceName.of("[SPACE]");
+   *   for (Membership element : chatServiceClient.listMemberships(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space for which to fetch a membership list. + *

Format: spaces/{space} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMembershipsPagedResponse listMemberships(SpaceName parent) { + ListMembershipsRequest request = + ListMembershipsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listMemberships(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists memberships in a space. For an example, see [List + * memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing + * memberships with [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists + * memberships in spaces that the Chat app has access to, but excludes Chat app memberships, + * including its own. Listing memberships with [User + * authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in + * spaces that the authenticated user has access to. + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String parent = SpaceName.of("[SPACE]").toString();
+   *   for (Membership element : chatServiceClient.listMemberships(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space for which to fetch a membership list. + *

Format: spaces/{space} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMembershipsPagedResponse listMemberships(String parent) { + ListMembershipsRequest request = ListMembershipsRequest.newBuilder().setParent(parent).build(); + return listMemberships(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists memberships in a space. For an example, see [List + * memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing + * memberships with [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists + * memberships in spaces that the Chat app has access to, but excludes Chat app memberships, + * including its own. Listing memberships with [User + * authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in + * spaces that the authenticated user has access to. + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListMembershipsRequest request =
+   *       ListMembershipsRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setShowGroups(true)
+   *           .setShowInvited(true)
+   *           .build();
+   *   for (Membership element : chatServiceClient.listMemberships(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 ListMembershipsPagedResponse listMemberships(ListMembershipsRequest request) { + return listMembershipsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists memberships in a space. For an example, see [List + * memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing + * memberships with [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists + * memberships in spaces that the Chat app has access to, but excludes Chat app memberships, + * including its own. Listing memberships with [User + * authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in + * spaces that the authenticated user has access to. + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListMembershipsRequest request =
+   *       ListMembershipsRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setShowGroups(true)
+   *           .setShowInvited(true)
+   *           .build();
+   *   ApiFuture future =
+   *       chatServiceClient.listMembershipsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Membership element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listMembershipsPagedCallable() { + return stub.listMembershipsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists memberships in a space. For an example, see [List + * memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing + * memberships with [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists + * memberships in spaces that the Chat app has access to, but excludes Chat app memberships, + * including its own. Listing memberships with [User + * authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in + * spaces that the authenticated user has access to. + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListMembershipsRequest request =
+   *       ListMembershipsRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setShowGroups(true)
+   *           .setShowInvited(true)
+   *           .build();
+   *   while (true) {
+   *     ListMembershipsResponse response =
+   *         chatServiceClient.listMembershipsCallable().call(request);
+   *     for (Membership element : response.getMembershipsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listMembershipsCallable() { + return stub.listMembershipsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a membership. For an example, see [Get a + * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]");
+   *   Membership response = chatServiceClient.getMembership(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the membership to retrieve. + *

To get the app's own membership, you can optionally use `spaces/{space}/members/app`. + *

Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + *

When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can use the user's + * email as an alias for `{member}`. For example, + * `spaces/{space}/members/example{@literal @}gmail.com` where `example{@literal @}gmail.com` + * is the email of the Google Chat user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Membership getMembership(MembershipName name) { + GetMembershipRequest request = + GetMembershipRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getMembership(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a membership. For an example, see [Get a + * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = MembershipName.of("[SPACE]", "[MEMBER]").toString();
+   *   Membership response = chatServiceClient.getMembership(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the membership to retrieve. + *

To get the app's own membership, you can optionally use `spaces/{space}/members/app`. + *

Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + *

When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can use the user's + * email as an alias for `{member}`. For example, + * `spaces/{space}/members/example{@literal @}gmail.com` where `example{@literal @}gmail.com` + * is the email of the Google Chat user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Membership getMembership(String name) { + GetMembershipRequest request = GetMembershipRequest.newBuilder().setName(name).build(); + return getMembership(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a membership. For an example, see [Get a + * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetMembershipRequest request =
+   *       GetMembershipRequest.newBuilder()
+   *           .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString())
+   *           .build();
+   *   Membership response = chatServiceClient.getMembership(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 Membership getMembership(GetMembershipRequest request) { + return getMembershipCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a membership. For an example, see [Get a + * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetMembershipRequest request =
+   *       GetMembershipRequest.newBuilder()
+   *           .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString())
+   *           .build();
+   *   ApiFuture future = chatServiceClient.getMembershipCallable().futureCall(request);
+   *   // Do something.
+   *   Membership response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getMembershipCallable() { + return stub.getMembershipCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a message. For an example, see [Read a + * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Note: Might return a message from a blocked member or space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   MessageName name = MessageName.of("[SPACE]", "[MESSAGE]");
+   *   Message response = chatServiceClient.getMessage(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the message. + *

Format: `spaces/{space}/messages/{message}` + *

If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Message getMessage(MessageName name) { + GetMessageRequest request = + GetMessageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getMessage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a message. For an example, see [Read a + * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Note: Might return a message from a blocked member or space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = MessageName.of("[SPACE]", "[MESSAGE]").toString();
+   *   Message response = chatServiceClient.getMessage(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the message. + *

Format: `spaces/{space}/messages/{message}` + *

If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Message getMessage(String name) { + GetMessageRequest request = GetMessageRequest.newBuilder().setName(name).build(); + return getMessage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a message. For an example, see [Read a + * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Note: Might return a message from a blocked member or space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetMessageRequest request =
+   *       GetMessageRequest.newBuilder()
+   *           .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .build();
+   *   Message response = chatServiceClient.getMessage(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 Message getMessage(GetMessageRequest request) { + return getMessageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a message. For an example, see [Read a + * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Note: Might return a message from a blocked member or space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetMessageRequest request =
+   *       GetMessageRequest.newBuilder()
+   *           .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .build();
+   *   ApiFuture future = chatServiceClient.getMessageCallable().futureCall(request);
+   *   // Do something.
+   *   Message response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getMessageCallable() { + return stub.getMessageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a message. There's a difference between the `patch` and `update` methods. The `patch` + * method uses a `patch` request while the `update` method uses a `put` request. We recommend + * using the `patch` method. For an example, see [Update a + * message](https://developers.google.com/chat/api/guides/v1/messages/update). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). When using app + * authentication, requests can only update messages created by the calling Chat app. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   Message message = Message.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Message response = chatServiceClient.updateMessage(message, updateMask);
+   * }
+   * }
+ * + * @param message Required. Message with fields updated. + * @param updateMask Required. The field paths to update. Separate multiple values with commas or + * use `*` to update all field paths. + *

Currently supported field paths: + *

- `text` + *

- `attachment` + *

- `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) + *

- `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) + *

- Developer Preview: `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Message updateMessage(Message message, FieldMask updateMask) { + UpdateMessageRequest request = + UpdateMessageRequest.newBuilder().setMessage(message).setUpdateMask(updateMask).build(); + return updateMessage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a message. There's a difference between the `patch` and `update` methods. The `patch` + * method uses a `patch` request while the `update` method uses a `put` request. We recommend + * using the `patch` method. For an example, see [Update a + * message](https://developers.google.com/chat/api/guides/v1/messages/update). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). When using app + * authentication, requests can only update messages created by the calling Chat app. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   UpdateMessageRequest request =
+   *       UpdateMessageRequest.newBuilder()
+   *           .setMessage(Message.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Message response = chatServiceClient.updateMessage(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 Message updateMessage(UpdateMessageRequest request) { + return updateMessageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a message. There's a difference between the `patch` and `update` methods. The `patch` + * method uses a `patch` request while the `update` method uses a `put` request. We recommend + * using the `patch` method. For an example, see [Update a + * message](https://developers.google.com/chat/api/guides/v1/messages/update). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). When using app + * authentication, requests can only update messages created by the calling Chat app. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   UpdateMessageRequest request =
+   *       UpdateMessageRequest.newBuilder()
+   *           .setMessage(Message.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = chatServiceClient.updateMessageCallable().futureCall(request);
+   *   // Do something.
+   *   Message response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateMessageCallable() { + return stub.updateMessageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a message. For an example, see [Delete a + * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). When using app + * authentication, requests can only delete messages created by the calling Chat app. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   MessageName name = MessageName.of("[SPACE]", "[MESSAGE]");
+   *   chatServiceClient.deleteMessage(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the message. + *

Format: `spaces/{space}/messages/{message}` + *

If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteMessage(MessageName name) { + DeleteMessageRequest request = + DeleteMessageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteMessage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a message. For an example, see [Delete a + * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). When using app + * authentication, requests can only delete messages created by the calling Chat app. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = MessageName.of("[SPACE]", "[MESSAGE]").toString();
+   *   chatServiceClient.deleteMessage(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the message. + *

Format: `spaces/{space}/messages/{message}` + *

If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteMessage(String name) { + DeleteMessageRequest request = DeleteMessageRequest.newBuilder().setName(name).build(); + deleteMessage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a message. For an example, see [Delete a + * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). When using app + * authentication, requests can only delete messages created by the calling Chat app. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteMessageRequest request =
+   *       DeleteMessageRequest.newBuilder()
+   *           .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   chatServiceClient.deleteMessage(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteMessage(DeleteMessageRequest request) { + deleteMessageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a message. For an example, see [Delete a + * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). When using app + * authentication, requests can only delete messages created by the calling Chat app. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteMessageRequest request =
+   *       DeleteMessageRequest.newBuilder()
+   *           .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = chatServiceClient.deleteMessageCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteMessageCallable() { + return stub.deleteMessageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the metadata of a message attachment. The attachment data is fetched using the [media + * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, + * see [Get a message + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * Requires [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   AttachmentName name = AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]");
+   *   Attachment response = chatServiceClient.getAttachment(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attachment getAttachment(AttachmentName name) { + GetAttachmentRequest request = + GetAttachmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the metadata of a message attachment. The attachment data is fetched using the [media + * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, + * see [Get a message + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * Requires [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]").toString();
+   *   Attachment response = chatServiceClient.getAttachment(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attachment getAttachment(String name) { + GetAttachmentRequest request = GetAttachmentRequest.newBuilder().setName(name).build(); + return getAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the metadata of a message attachment. The attachment data is fetched using the [media + * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, + * see [Get a message + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * Requires [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetAttachmentRequest request =
+   *       GetAttachmentRequest.newBuilder()
+   *           .setName(AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]").toString())
+   *           .build();
+   *   Attachment response = chatServiceClient.getAttachment(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 Attachment getAttachment(GetAttachmentRequest request) { + return getAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the metadata of a message attachment. The attachment data is fetched using the [media + * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, + * see [Get a message + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * Requires [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetAttachmentRequest request =
+   *       GetAttachmentRequest.newBuilder()
+   *           .setName(AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]").toString())
+   *           .build();
+   *   ApiFuture future = chatServiceClient.getAttachmentCallable().futureCall(request);
+   *   // Do something.
+   *   Attachment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAttachmentCallable() { + return stub.getAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Uploads an attachment. For an example, see [Upload media as a file + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). + * Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

You can upload attachments up to 200 MB. Certain file types aren't supported. For details, + * see [File types blocked by Google + * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   UploadAttachmentRequest request =
+   *       UploadAttachmentRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setFilename("filename-734768633")
+   *           .build();
+   *   UploadAttachmentResponse response = chatServiceClient.uploadAttachment(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 UploadAttachmentResponse uploadAttachment(UploadAttachmentRequest request) { + return uploadAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Uploads an attachment. For an example, see [Upload media as a file + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). + * Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

You can upload attachments up to 200 MB. Certain file types aren't supported. For details, + * see [File types blocked by Google + * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   UploadAttachmentRequest request =
+   *       UploadAttachmentRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setFilename("filename-734768633")
+   *           .build();
+   *   ApiFuture future =
+   *       chatServiceClient.uploadAttachmentCallable().futureCall(request);
+   *   // Do something.
+   *   UploadAttachmentResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + uploadAttachmentCallable() { + return stub.uploadAttachmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first + * message is sent. For an example, see [List + * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed + * until the first message is sent. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   for (Space element : chatServiceClient.listSpaces().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 ListSpacesPagedResponse listSpaces() { + ListSpacesRequest request = ListSpacesRequest.newBuilder().build(); + return listSpaces(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first + * message is sent. For an example, see [List + * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed + * until the first message is sent. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListSpacesRequest request =
+   *       ListSpacesRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Space element : chatServiceClient.listSpaces(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 ListSpacesPagedResponse listSpaces(ListSpacesRequest request) { + return listSpacesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first + * message is sent. For an example, see [List + * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed + * until the first message is sent. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListSpacesRequest request =
+   *       ListSpacesRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future = chatServiceClient.listSpacesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Space element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSpacesPagedCallable() { + return stub.listSpacesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first + * message is sent. For an example, see [List + * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed + * until the first message is sent. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListSpacesRequest request =
+   *       ListSpacesRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListSpacesResponse response = chatServiceClient.listSpacesCallable().call(request);
+   *     for (Space element : response.getSpacesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSpacesCallable() { + return stub.listSpacesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a space. For an example, see [Get a + * space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SpaceName name = SpaceName.of("[SPACE]");
+   *   Space response = chatServiceClient.getSpace(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the space, in the form "spaces/*". + *

Format: `spaces/{space}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Space getSpace(SpaceName name) { + GetSpaceRequest request = + GetSpaceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSpace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a space. For an example, see [Get a + * space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = SpaceName.of("[SPACE]").toString();
+   *   Space response = chatServiceClient.getSpace(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the space, in the form "spaces/*". + *

Format: `spaces/{space}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Space getSpace(String name) { + GetSpaceRequest request = GetSpaceRequest.newBuilder().setName(name).build(); + return getSpace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a space. For an example, see [Get a + * space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetSpaceRequest request =
+   *       GetSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build();
+   *   Space response = chatServiceClient.getSpace(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 Space getSpace(GetSpaceRequest request) { + return getSpaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns details about a space. For an example, see [Get a + * space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * + *

Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   GetSpaceRequest request =
+   *       GetSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build();
+   *   ApiFuture future = chatServiceClient.getSpaceCallable().futureCall(request);
+   *   // Do something.
+   *   Space response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSpaceCallable() { + return stub.getSpaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a + * space](https://developers.google.com/chat/api/guides/v1/spaces/create). + * + *

If you receive the error message `ALREADY_EXISTS` when creating a space, try a different + * `displayName`. An existing space within the Google Workspace organization might already use + * this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   Space space = Space.newBuilder().build();
+   *   Space response = chatServiceClient.createSpace(space);
+   * }
+   * }
+ * + * @param space Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + *

If you receive the error message `ALREADY_EXISTS` when creating a space, try a different + * `displayName`. An existing space within the Google Workspace organization might already use + * this display name. + *

The space `name` is assigned on the server so anything specified in this field will be + * ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Space createSpace(Space space) { + CreateSpaceRequest request = CreateSpaceRequest.newBuilder().setSpace(space).build(); + return createSpace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a + * space](https://developers.google.com/chat/api/guides/v1/spaces/create). + * + *

If you receive the error message `ALREADY_EXISTS` when creating a space, try a different + * `displayName`. An existing space within the Google Workspace organization might already use + * this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateSpaceRequest request =
+   *       CreateSpaceRequest.newBuilder()
+   *           .setSpace(Space.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Space response = chatServiceClient.createSpace(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 Space createSpace(CreateSpaceRequest request) { + return createSpaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a + * space](https://developers.google.com/chat/api/guides/v1/spaces/create). + * + *

If you receive the error message `ALREADY_EXISTS` when creating a space, try a different + * `displayName`. An existing space within the Google Workspace organization might already use + * this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateSpaceRequest request =
+   *       CreateSpaceRequest.newBuilder()
+   *           .setSpace(Space.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = chatServiceClient.createSpaceCallable().futureCall(request);
+   *   // Do something.
+   *   Space response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSpaceCallable() { + return stub.createSpaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a space and adds specified users to it. The calling user is automatically added to the + * space, and shouldn't be specified as a membership in the request. For an example, see [Set up a + * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). + * + *

To specify the human members to add, add memberships with the appropriate `member.name` in + * the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the + * email address for the user. For users in the same Workspace organization `{user}` can also be + * the `id` for the person from the People API, or the `id` for the user in the Directory API. For + * example, if the People API Person profile ID for `user{@literal @}example.com` is `123456789`, + * you can add the user to the space by setting the `membership.member.name` to + * `users/user{@literal @}example.com` or `users/123456789`. + * + *

For a space or group chat, if the caller blocks or is blocked by some members, then those + * members aren't added to the created space. + * + *

To create a direct message (DM) between the calling user and another human user, specify + * exactly one membership to represent the human user. If one user blocks the other, the request + * fails and the DM isn't created. + * + *

To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to + * `true` and don't specify any memberships. You can only use this method to set up a DM with the + * calling app. To add the calling app as a member of a space or an existing DM between two human + * users, see [create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * + *

If a DM already exists between two users, even when one user blocks the other at the time a + * request is made, then the existing DM is returned. + * + *

Spaces with threaded replies aren't supported. If you receive the error message + * `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SetUpSpaceRequest request =
+   *       SetUpSpaceRequest.newBuilder()
+   *           .setSpace(Space.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .addAllMemberships(new ArrayList())
+   *           .build();
+   *   Space response = chatServiceClient.setUpSpace(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 Space setUpSpace(SetUpSpaceRequest request) { + return setUpSpaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a space and adds specified users to it. The calling user is automatically added to the + * space, and shouldn't be specified as a membership in the request. For an example, see [Set up a + * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). + * + *

To specify the human members to add, add memberships with the appropriate `member.name` in + * the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the + * email address for the user. For users in the same Workspace organization `{user}` can also be + * the `id` for the person from the People API, or the `id` for the user in the Directory API. For + * example, if the People API Person profile ID for `user{@literal @}example.com` is `123456789`, + * you can add the user to the space by setting the `membership.member.name` to + * `users/user{@literal @}example.com` or `users/123456789`. + * + *

For a space or group chat, if the caller blocks or is blocked by some members, then those + * members aren't added to the created space. + * + *

To create a direct message (DM) between the calling user and another human user, specify + * exactly one membership to represent the human user. If one user blocks the other, the request + * fails and the DM isn't created. + * + *

To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to + * `true` and don't specify any memberships. You can only use this method to set up a DM with the + * calling app. To add the calling app as a member of a space or an existing DM between two human + * users, see [create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * + *

If a DM already exists between two users, even when one user blocks the other at the time a + * request is made, then the existing DM is returned. + * + *

Spaces with threaded replies aren't supported. If you receive the error message + * `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SetUpSpaceRequest request =
+   *       SetUpSpaceRequest.newBuilder()
+   *           .setSpace(Space.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .addAllMemberships(new ArrayList())
+   *           .build();
+   *   ApiFuture future = chatServiceClient.setUpSpaceCallable().futureCall(request);
+   *   // Do something.
+   *   Space response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setUpSpaceCallable() { + return stub.setUpSpaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a space. For an example, see [Update a + * space](https://developers.google.com/chat/api/guides/v1/spaces/update). + * + *

If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, + * try a different display name.. An existing space within the Google Workspace organization might + * already use this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   Space space = Space.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Space response = chatServiceClient.updateSpace(space, updateMask);
+   * }
+   * }
+ * + * @param space Required. Space with fields to be updated. `Space.name` must be populated in the + * form of `spaces/{space}`. Only fields specified by `update_mask` are updated. + * @param updateMask Required. The updated field paths, comma separated if there are multiple. + *

Currently supported field paths: + *

- `display_name` (Only supports changing the display name of a space with the `SPACE` + * type, or when also including the `space_type` mask to change a `GROUP_CHAT` space type to + * `SPACE`. Trying to update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space + * results in an invalid argument error. If you receive the error message `ALREADY_EXISTS` + * when updating the `displayName`, try a different `displayName`. An existing space within + * the Google Workspace organization might already use this display name.) + *

- `space_type` (Only supports changing a `GROUP_CHAT` space type to `SPACE`. Include + * `display_name` together with `space_type` in the update mask and ensure that the specified + * space has a non-empty display name and the `SPACE` space type. Including the `space_type` + * mask and the `SPACE` type in the specified space when updating the display name is optional + * if the existing space already has the `SPACE` type. Trying to update the space type in + * other ways results in an invalid argument error). + *

- `space_details` + *

- `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization allows users to + * change their history setting](https://support.google.com/a/answer/7664184). Warning: + * mutually exclusive with all other field paths.) - Developer Preview: + * `access_settings.audience` (Supports changing the [access + * setting](https://support.google.com/chat/answer/11971020) of a space. If no audience is + * specified in the access setting, the space's access setting is updated to restricted. + * Warning: mutually exclusive with all other field paths.) + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Space updateSpace(Space space, FieldMask updateMask) { + UpdateSpaceRequest request = + UpdateSpaceRequest.newBuilder().setSpace(space).setUpdateMask(updateMask).build(); + return updateSpace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a space. For an example, see [Update a + * space](https://developers.google.com/chat/api/guides/v1/spaces/update). + * + *

If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, + * try a different display name.. An existing space within the Google Workspace organization might + * already use this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   UpdateSpaceRequest request =
+   *       UpdateSpaceRequest.newBuilder()
+   *           .setSpace(Space.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Space response = chatServiceClient.updateSpace(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 Space updateSpace(UpdateSpaceRequest request) { + return updateSpaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a space. For an example, see [Update a + * space](https://developers.google.com/chat/api/guides/v1/spaces/update). + * + *

If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, + * try a different display name.. An existing space within the Google Workspace organization might + * already use this display name. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   UpdateSpaceRequest request =
+   *       UpdateSpaceRequest.newBuilder()
+   *           .setSpace(Space.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = chatServiceClient.updateSpaceCallable().futureCall(request);
+   *   // Do something.
+   *   Space response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSpaceCallable() { + return stub.updateSpaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a named space. Always performs a cascading delete, which means that the space's child + * resources—like messages posted in the space and memberships in the space—are also deleted. For + * an example, see [Delete a + * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) from a user who has + * permission to delete the space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SpaceName name = SpaceName.of("[SPACE]");
+   *   chatServiceClient.deleteSpace(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the space to delete. + *

Format: `spaces/{space}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSpace(SpaceName name) { + DeleteSpaceRequest request = + DeleteSpaceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteSpace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a named space. Always performs a cascading delete, which means that the space's child + * resources—like messages posted in the space and memberships in the space—are also deleted. For + * an example, see [Delete a + * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) from a user who has + * permission to delete the space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = SpaceName.of("[SPACE]").toString();
+   *   chatServiceClient.deleteSpace(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the space to delete. + *

Format: `spaces/{space}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSpace(String name) { + DeleteSpaceRequest request = DeleteSpaceRequest.newBuilder().setName(name).build(); + deleteSpace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a named space. Always performs a cascading delete, which means that the space's child + * resources—like messages posted in the space and memberships in the space—are also deleted. For + * an example, see [Delete a + * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) from a user who has + * permission to delete the space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteSpaceRequest request =
+   *       DeleteSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build();
+   *   chatServiceClient.deleteSpace(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSpace(DeleteSpaceRequest request) { + deleteSpaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a named space. Always performs a cascading delete, which means that the space's child + * resources—like messages posted in the space and memberships in the space—are also deleted. For + * an example, see [Delete a + * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) from a user who has + * permission to delete the space. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteSpaceRequest request =
+   *       DeleteSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build();
+   *   ApiFuture future = chatServiceClient.deleteSpaceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSpaceCallable() { + return stub.deleteSpaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Completes the [import process](https://developers.google.com/chat/api/guides/import-data) for + * the specified space and makes it visible to users. Requires app authentication and domain-wide + * delegation. For more information, see [Authorize Google Chat apps to import + * data](https://developers.google.com/chat/api/guides/authorize-import). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CompleteImportSpaceRequest request =
+   *       CompleteImportSpaceRequest.newBuilder()
+   *           .setName(SpaceName.of("[SPACE]").toString())
+   *           .build();
+   *   CompleteImportSpaceResponse response = chatServiceClient.completeImportSpace(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 CompleteImportSpaceResponse completeImportSpace(CompleteImportSpaceRequest request) { + return completeImportSpaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Completes the [import process](https://developers.google.com/chat/api/guides/import-data) for + * the specified space and makes it visible to users. Requires app authentication and domain-wide + * delegation. For more information, see [Authorize Google Chat apps to import + * data](https://developers.google.com/chat/api/guides/authorize-import). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CompleteImportSpaceRequest request =
+   *       CompleteImportSpaceRequest.newBuilder()
+   *           .setName(SpaceName.of("[SPACE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       chatServiceClient.completeImportSpaceCallable().futureCall(request);
+   *   // Do something.
+   *   CompleteImportSpaceResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + completeImportSpaceCallable() { + return stub.completeImportSpaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the existing direct message with the specified user. If no direct message space is + * found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct + * message](/chat/api/guides/v1/spaces/find-direct-message). + * + *

With [user authentication](https://developers.google.com/chat/api/guides/auth/users), + * returns the direct message space between the specified user and the authenticated user. + * + *

With [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns + * the direct message space between the specified user and the calling Chat app. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or + * [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   FindDirectMessageRequest request =
+   *       FindDirectMessageRequest.newBuilder().setName("name3373707").build();
+   *   Space response = chatServiceClient.findDirectMessage(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 Space findDirectMessage(FindDirectMessageRequest request) { + return findDirectMessageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the existing direct message with the specified user. If no direct message space is + * found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct + * message](/chat/api/guides/v1/spaces/find-direct-message). + * + *

With [user authentication](https://developers.google.com/chat/api/guides/auth/users), + * returns the direct message space between the specified user and the authenticated user. + * + *

With [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns + * the direct message space between the specified user and the calling Chat app. + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or + * [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   FindDirectMessageRequest request =
+   *       FindDirectMessageRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = chatServiceClient.findDirectMessageCallable().futureCall(request);
+   *   // Do something.
+   *   Space response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable findDirectMessageCallable() { + return stub.findDirectMessageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a human membership or app membership for the calling app. Creating memberships for + * other apps isn't supported. For an example, see [ Create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a + * membership, if the specified member has their auto-accept policy turned off, then they're + * invited, and must accept the space invitation before joining. Otherwise, creating a membership + * adds the member directly to the specified space. Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

To specify the member to add, set the `membership.member.name` in the + * `CreateMembershipRequest`: + * + *

- To add the calling app to a space or a direct message between two human users, use + * `users/app`. Unable to add other apps to the space. + * + *

- To add a human user, use `users/{user}`, where `{user}` can be the email address for the + * user. For users in the same Workspace organization `{user}` can also be the `id` for the person + * from the People API, or the `id` for the user in the Directory API. For example, if the People + * API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to + * the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or + * `users/123456789`. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   SpaceName parent = SpaceName.of("[SPACE]");
+   *   Membership membership = Membership.newBuilder().build();
+   *   Membership response = chatServiceClient.createMembership(parent, membership);
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space for which to create the membership. + *

Format: spaces/{space} + * @param membership Required. The membership relation to create. The `memberType` field must + * contain a user with the `user.name` and `user.type` fields populated. The server will + * assign a resource name and overwrite anything specified. When a Chat app creates a + * membership relation for a human user, it must use the `chat.memberships` scope, set + * `user.type` to `HUMAN`, and set `user.name` with format `users/{user}`, where `{user}` can + * be the email address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or + * the `id` for the user in the Directory API. For example, if the People API Person profile + * ID for `user{@literal @}example.com` is `123456789`, you can add the user to the space by + * setting the `membership.member.name` to `users/user{@literal @}example.com` or + * `users/123456789`. When a Chat app creates a membership relation for itself, it must use + * the `chat.memberships.app` scope, set `user.type` to `BOT`, and set `user.name` to + * `users/app`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Membership createMembership(SpaceName parent, Membership membership) { + CreateMembershipRequest request = + CreateMembershipRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setMembership(membership) + .build(); + return createMembership(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a human membership or app membership for the calling app. Creating memberships for + * other apps isn't supported. For an example, see [ Create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a + * membership, if the specified member has their auto-accept policy turned off, then they're + * invited, and must accept the space invitation before joining. Otherwise, creating a membership + * adds the member directly to the specified space. Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

To specify the member to add, set the `membership.member.name` in the + * `CreateMembershipRequest`: + * + *

- To add the calling app to a space or a direct message between two human users, use + * `users/app`. Unable to add other apps to the space. + * + *

- To add a human user, use `users/{user}`, where `{user}` can be the email address for the + * user. For users in the same Workspace organization `{user}` can also be the `id` for the person + * from the People API, or the `id` for the user in the Directory API. For example, if the People + * API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to + * the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or + * `users/123456789`. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String parent = SpaceName.of("[SPACE]").toString();
+   *   Membership membership = Membership.newBuilder().build();
+   *   Membership response = chatServiceClient.createMembership(parent, membership);
+   * }
+   * }
+ * + * @param parent Required. The resource name of the space for which to create the membership. + *

Format: spaces/{space} + * @param membership Required. The membership relation to create. The `memberType` field must + * contain a user with the `user.name` and `user.type` fields populated. The server will + * assign a resource name and overwrite anything specified. When a Chat app creates a + * membership relation for a human user, it must use the `chat.memberships` scope, set + * `user.type` to `HUMAN`, and set `user.name` with format `users/{user}`, where `{user}` can + * be the email address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or + * the `id` for the user in the Directory API. For example, if the People API Person profile + * ID for `user{@literal @}example.com` is `123456789`, you can add the user to the space by + * setting the `membership.member.name` to `users/user{@literal @}example.com` or + * `users/123456789`. When a Chat app creates a membership relation for itself, it must use + * the `chat.memberships.app` scope, set `user.type` to `BOT`, and set `user.name` to + * `users/app`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Membership createMembership(String parent, Membership membership) { + CreateMembershipRequest request = + CreateMembershipRequest.newBuilder().setParent(parent).setMembership(membership).build(); + return createMembership(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a human membership or app membership for the calling app. Creating memberships for + * other apps isn't supported. For an example, see [ Create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a + * membership, if the specified member has their auto-accept policy turned off, then they're + * invited, and must accept the space invitation before joining. Otherwise, creating a membership + * adds the member directly to the specified space. Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

To specify the member to add, set the `membership.member.name` in the + * `CreateMembershipRequest`: + * + *

- To add the calling app to a space or a direct message between two human users, use + * `users/app`. Unable to add other apps to the space. + * + *

- To add a human user, use `users/{user}`, where `{user}` can be the email address for the + * user. For users in the same Workspace organization `{user}` can also be the `id` for the person + * from the People API, or the `id` for the user in the Directory API. For example, if the People + * API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to + * the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or + * `users/123456789`. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateMembershipRequest request =
+   *       CreateMembershipRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setMembership(Membership.newBuilder().build())
+   *           .build();
+   *   Membership response = chatServiceClient.createMembership(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 Membership createMembership(CreateMembershipRequest request) { + return createMembershipCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a human membership or app membership for the calling app. Creating memberships for + * other apps isn't supported. For an example, see [ Create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a + * membership, if the specified member has their auto-accept policy turned off, then they're + * invited, and must accept the space invitation before joining. Otherwise, creating a membership + * adds the member directly to the specified space. Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

To specify the member to add, set the `membership.member.name` in the + * `CreateMembershipRequest`: + * + *

- To add the calling app to a space or a direct message between two human users, use + * `users/app`. Unable to add other apps to the space. + * + *

- To add a human user, use `users/{user}`, where `{user}` can be the email address for the + * user. For users in the same Workspace organization `{user}` can also be the `id` for the person + * from the People API, or the `id` for the user in the Directory API. For example, if the People + * API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to + * the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or + * `users/123456789`. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateMembershipRequest request =
+   *       CreateMembershipRequest.newBuilder()
+   *           .setParent(SpaceName.of("[SPACE]").toString())
+   *           .setMembership(Membership.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       chatServiceClient.createMembershipCallable().futureCall(request);
+   *   // Do something.
+   *   Membership response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createMembershipCallable() { + return stub.createMembershipCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a membership. For an example, see [Delete a + * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]");
+   *   Membership response = chatServiceClient.deleteMembership(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the membership to delete. Chat apps can delete human + * users' or their own memberships. Chat apps can't delete other apps' memberships. + *

When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. + * For example, `spaces/{space}/members/example{@literal @}gmail.com` where + * `example{@literal @}gmail.com` is the email of the Google Chat user. + *

When deleting an app membership, requires the `chat.memberships.app` scope and + * `spaces/{space}/members/app` format. + *

Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Membership deleteMembership(MembershipName name) { + DeleteMembershipRequest request = + DeleteMembershipRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteMembership(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a membership. For an example, see [Delete a + * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = MembershipName.of("[SPACE]", "[MEMBER]").toString();
+   *   Membership response = chatServiceClient.deleteMembership(name);
+   * }
+   * }
+ * + * @param name Required. Resource name of the membership to delete. Chat apps can delete human + * users' or their own memberships. Chat apps can't delete other apps' memberships. + *

When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. + * For example, `spaces/{space}/members/example{@literal @}gmail.com` where + * `example{@literal @}gmail.com` is the email of the Google Chat user. + *

When deleting an app membership, requires the `chat.memberships.app` scope and + * `spaces/{space}/members/app` format. + *

Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Membership deleteMembership(String name) { + DeleteMembershipRequest request = DeleteMembershipRequest.newBuilder().setName(name).build(); + return deleteMembership(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a membership. For an example, see [Delete a + * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteMembershipRequest request =
+   *       DeleteMembershipRequest.newBuilder()
+   *           .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString())
+   *           .build();
+   *   Membership response = chatServiceClient.deleteMembership(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 Membership deleteMembership(DeleteMembershipRequest request) { + return deleteMembershipCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a membership. For an example, see [Delete a + * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * + *

Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteMembershipRequest request =
+   *       DeleteMembershipRequest.newBuilder()
+   *           .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       chatServiceClient.deleteMembershipCallable().futureCall(request);
+   *   // Do something.
+   *   Membership response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteMembershipCallable() { + return stub.deleteMembershipCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a reaction and adds it to a message. For an example, see [Create a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). Only unicode emoji + * are supported. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]");
+   *   Reaction reaction = Reaction.newBuilder().build();
+   *   Reaction response = chatServiceClient.createReaction(parent, reaction);
+   * }
+   * }
+ * + * @param parent Required. The message where the reaction is created. + *

Format: `spaces/{space}/messages/{message}` + * @param reaction Required. The reaction to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Reaction createReaction(MessageName parent, Reaction reaction) { + CreateReactionRequest request = + CreateReactionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setReaction(reaction) + .build(); + return createReaction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a reaction and adds it to a message. For an example, see [Create a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). Only unicode emoji + * are supported. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String parent = MessageName.of("[SPACE]", "[MESSAGE]").toString();
+   *   Reaction reaction = Reaction.newBuilder().build();
+   *   Reaction response = chatServiceClient.createReaction(parent, reaction);
+   * }
+   * }
+ * + * @param parent Required. The message where the reaction is created. + *

Format: `spaces/{space}/messages/{message}` + * @param reaction Required. The reaction to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Reaction createReaction(String parent, Reaction reaction) { + CreateReactionRequest request = + CreateReactionRequest.newBuilder().setParent(parent).setReaction(reaction).build(); + return createReaction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a reaction and adds it to a message. For an example, see [Create a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). Only unicode emoji + * are supported. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateReactionRequest request =
+   *       CreateReactionRequest.newBuilder()
+   *           .setParent(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .setReaction(Reaction.newBuilder().build())
+   *           .build();
+   *   Reaction response = chatServiceClient.createReaction(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 Reaction createReaction(CreateReactionRequest request) { + return createReactionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a reaction and adds it to a message. For an example, see [Create a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). Only unicode emoji + * are supported. + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   CreateReactionRequest request =
+   *       CreateReactionRequest.newBuilder()
+   *           .setParent(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .setReaction(Reaction.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = chatServiceClient.createReactionCallable().futureCall(request);
+   *   // Do something.
+   *   Reaction response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createReactionCallable() { + return stub.createReactionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists reactions to a message. For an example, see [List + * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]");
+   *   for (Reaction element : chatServiceClient.listReactions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The message users reacted to. + *

Format: `spaces/{space}/messages/{message}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReactionsPagedResponse listReactions(MessageName parent) { + ListReactionsRequest request = + ListReactionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listReactions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists reactions to a message. For an example, see [List + * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String parent = MessageName.of("[SPACE]", "[MESSAGE]").toString();
+   *   for (Reaction element : chatServiceClient.listReactions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The message users reacted to. + *

Format: `spaces/{space}/messages/{message}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReactionsPagedResponse listReactions(String parent) { + ListReactionsRequest request = ListReactionsRequest.newBuilder().setParent(parent).build(); + return listReactions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists reactions to a message. For an example, see [List + * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListReactionsRequest request =
+   *       ListReactionsRequest.newBuilder()
+   *           .setParent(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Reaction element : chatServiceClient.listReactions(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 ListReactionsPagedResponse listReactions(ListReactionsRequest request) { + return listReactionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists reactions to a message. For an example, see [List + * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListReactionsRequest request =
+   *       ListReactionsRequest.newBuilder()
+   *           .setParent(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       chatServiceClient.listReactionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Reaction element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listReactionsPagedCallable() { + return stub.listReactionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists reactions to a message. For an example, see [List + * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ListReactionsRequest request =
+   *       ListReactionsRequest.newBuilder()
+   *           .setParent(MessageName.of("[SPACE]", "[MESSAGE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListReactionsResponse response = chatServiceClient.listReactionsCallable().call(request);
+   *     for (Reaction element : response.getReactionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listReactionsCallable() { + return stub.listReactionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a reaction to a message. For an example, see [Delete a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   ReactionName name = ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]");
+   *   chatServiceClient.deleteReaction(name);
+   * }
+   * }
+ * + * @param name Required. Name of the reaction to delete. + *

Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReaction(ReactionName name) { + DeleteReactionRequest request = + DeleteReactionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteReaction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a reaction to a message. For an example, see [Delete a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   String name = ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]").toString();
+   *   chatServiceClient.deleteReaction(name);
+   * }
+   * }
+ * + * @param name Required. Name of the reaction to delete. + *

Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReaction(String name) { + DeleteReactionRequest request = DeleteReactionRequest.newBuilder().setName(name).build(); + deleteReaction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a reaction to a message. For an example, see [Delete a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteReactionRequest request =
+   *       DeleteReactionRequest.newBuilder()
+   *           .setName(ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]").toString())
+   *           .build();
+   *   chatServiceClient.deleteReaction(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReaction(DeleteReactionRequest request) { + deleteReactionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a reaction to a message. For an example, see [Delete a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + *

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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+   *   DeleteReactionRequest request =
+   *       DeleteReactionRequest.newBuilder()
+   *           .setName(ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]").toString())
+   *           .build();
+   *   ApiFuture future = chatServiceClient.deleteReactionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteReactionCallable() { + return stub.deleteReactionCallable(); + } + + @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 ListMessagesPagedResponse + extends AbstractPagedListResponse< + ListMessagesRequest, + ListMessagesResponse, + Message, + ListMessagesPage, + ListMessagesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMessagesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListMessagesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListMessagesPagedResponse(ListMessagesPage page) { + super(page, ListMessagesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListMessagesPage + extends AbstractPage { + + private ListMessagesPage( + PageContext context, + ListMessagesResponse response) { + super(context, response); + } + + private static ListMessagesPage createEmptyPage() { + return new ListMessagesPage(null, null); + } + + @Override + protected ListMessagesPage createPage( + PageContext context, + ListMessagesResponse response) { + return new ListMessagesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListMessagesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMessagesRequest, + ListMessagesResponse, + Message, + ListMessagesPage, + ListMessagesFixedSizeCollection> { + + private ListMessagesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMessagesFixedSizeCollection createEmptyCollection() { + return new ListMessagesFixedSizeCollection(null, 0); + } + + @Override + protected ListMessagesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMessagesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListMembershipsPagedResponse + extends AbstractPagedListResponse< + ListMembershipsRequest, + ListMembershipsResponse, + Membership, + ListMembershipsPage, + ListMembershipsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMembershipsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListMembershipsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListMembershipsPagedResponse(ListMembershipsPage page) { + super(page, ListMembershipsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListMembershipsPage + extends AbstractPage< + ListMembershipsRequest, ListMembershipsResponse, Membership, ListMembershipsPage> { + + private ListMembershipsPage( + PageContext context, + ListMembershipsResponse response) { + super(context, response); + } + + private static ListMembershipsPage createEmptyPage() { + return new ListMembershipsPage(null, null); + } + + @Override + protected ListMembershipsPage createPage( + PageContext context, + ListMembershipsResponse response) { + return new ListMembershipsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListMembershipsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMembershipsRequest, + ListMembershipsResponse, + Membership, + ListMembershipsPage, + ListMembershipsFixedSizeCollection> { + + private ListMembershipsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMembershipsFixedSizeCollection createEmptyCollection() { + return new ListMembershipsFixedSizeCollection(null, 0); + } + + @Override + protected ListMembershipsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMembershipsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSpacesPagedResponse + extends AbstractPagedListResponse< + ListSpacesRequest, + ListSpacesResponse, + Space, + ListSpacesPage, + ListSpacesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSpacesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListSpacesPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListSpacesPagedResponse(ListSpacesPage page) { + super(page, ListSpacesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSpacesPage + extends AbstractPage { + + private ListSpacesPage( + PageContext context, + ListSpacesResponse response) { + super(context, response); + } + + private static ListSpacesPage createEmptyPage() { + return new ListSpacesPage(null, null); + } + + @Override + protected ListSpacesPage createPage( + PageContext context, + ListSpacesResponse response) { + return new ListSpacesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSpacesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSpacesRequest, + ListSpacesResponse, + Space, + ListSpacesPage, + ListSpacesFixedSizeCollection> { + + private ListSpacesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSpacesFixedSizeCollection createEmptyCollection() { + return new ListSpacesFixedSizeCollection(null, 0); + } + + @Override + protected ListSpacesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSpacesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListReactionsPagedResponse + extends AbstractPagedListResponse< + ListReactionsRequest, + ListReactionsResponse, + Reaction, + ListReactionsPage, + ListReactionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListReactionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListReactionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListReactionsPagedResponse(ListReactionsPage page) { + super(page, ListReactionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListReactionsPage + extends AbstractPage< + ListReactionsRequest, ListReactionsResponse, Reaction, ListReactionsPage> { + + private ListReactionsPage( + PageContext context, + ListReactionsResponse response) { + super(context, response); + } + + private static ListReactionsPage createEmptyPage() { + return new ListReactionsPage(null, null); + } + + @Override + protected ListReactionsPage createPage( + PageContext context, + ListReactionsResponse response) { + return new ListReactionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListReactionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListReactionsRequest, + ListReactionsResponse, + Reaction, + ListReactionsPage, + ListReactionsFixedSizeCollection> { + + private ListReactionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListReactionsFixedSizeCollection createEmptyCollection() { + return new ListReactionsFixedSizeCollection(null, 0); + } + + @Override + protected ListReactionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListReactionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceSettings.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceSettings.java new file mode 100644 index 000000000000..3c8830e1a874 --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceSettings.java @@ -0,0 +1,435 @@ +/* + * 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.chat.v1; + +import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.chat.v1.stub.ChatServiceStubSettings; +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 ChatServiceClient}. + * + *

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

    + *
  • The default service address (chat.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 createMessage 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
+ * ChatServiceSettings.Builder chatServiceSettingsBuilder = ChatServiceSettings.newBuilder();
+ * chatServiceSettingsBuilder
+ *     .createMessageSettings()
+ *     .setRetrySettings(
+ *         chatServiceSettingsBuilder
+ *             .createMessageSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ChatServiceSettings chatServiceSettings = chatServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ChatServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createMessage. */ + public UnaryCallSettings createMessageSettings() { + return ((ChatServiceStubSettings) getStubSettings()).createMessageSettings(); + } + + /** Returns the object with the settings used for calls to listMessages. */ + public PagedCallSettings + listMessagesSettings() { + return ((ChatServiceStubSettings) getStubSettings()).listMessagesSettings(); + } + + /** Returns the object with the settings used for calls to listMemberships. */ + public PagedCallSettings< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> + listMembershipsSettings() { + return ((ChatServiceStubSettings) getStubSettings()).listMembershipsSettings(); + } + + /** Returns the object with the settings used for calls to getMembership. */ + public UnaryCallSettings getMembershipSettings() { + return ((ChatServiceStubSettings) getStubSettings()).getMembershipSettings(); + } + + /** Returns the object with the settings used for calls to getMessage. */ + public UnaryCallSettings getMessageSettings() { + return ((ChatServiceStubSettings) getStubSettings()).getMessageSettings(); + } + + /** Returns the object with the settings used for calls to updateMessage. */ + public UnaryCallSettings updateMessageSettings() { + return ((ChatServiceStubSettings) getStubSettings()).updateMessageSettings(); + } + + /** Returns the object with the settings used for calls to deleteMessage. */ + public UnaryCallSettings deleteMessageSettings() { + return ((ChatServiceStubSettings) getStubSettings()).deleteMessageSettings(); + } + + /** Returns the object with the settings used for calls to getAttachment. */ + public UnaryCallSettings getAttachmentSettings() { + return ((ChatServiceStubSettings) getStubSettings()).getAttachmentSettings(); + } + + /** Returns the object with the settings used for calls to uploadAttachment. */ + public UnaryCallSettings + uploadAttachmentSettings() { + return ((ChatServiceStubSettings) getStubSettings()).uploadAttachmentSettings(); + } + + /** Returns the object with the settings used for calls to listSpaces. */ + public PagedCallSettings + listSpacesSettings() { + return ((ChatServiceStubSettings) getStubSettings()).listSpacesSettings(); + } + + /** Returns the object with the settings used for calls to getSpace. */ + public UnaryCallSettings getSpaceSettings() { + return ((ChatServiceStubSettings) getStubSettings()).getSpaceSettings(); + } + + /** Returns the object with the settings used for calls to createSpace. */ + public UnaryCallSettings createSpaceSettings() { + return ((ChatServiceStubSettings) getStubSettings()).createSpaceSettings(); + } + + /** Returns the object with the settings used for calls to setUpSpace. */ + public UnaryCallSettings setUpSpaceSettings() { + return ((ChatServiceStubSettings) getStubSettings()).setUpSpaceSettings(); + } + + /** Returns the object with the settings used for calls to updateSpace. */ + public UnaryCallSettings updateSpaceSettings() { + return ((ChatServiceStubSettings) getStubSettings()).updateSpaceSettings(); + } + + /** Returns the object with the settings used for calls to deleteSpace. */ + public UnaryCallSettings deleteSpaceSettings() { + return ((ChatServiceStubSettings) getStubSettings()).deleteSpaceSettings(); + } + + /** Returns the object with the settings used for calls to completeImportSpace. */ + public UnaryCallSettings + completeImportSpaceSettings() { + return ((ChatServiceStubSettings) getStubSettings()).completeImportSpaceSettings(); + } + + /** Returns the object with the settings used for calls to findDirectMessage. */ + public UnaryCallSettings findDirectMessageSettings() { + return ((ChatServiceStubSettings) getStubSettings()).findDirectMessageSettings(); + } + + /** Returns the object with the settings used for calls to createMembership. */ + public UnaryCallSettings createMembershipSettings() { + return ((ChatServiceStubSettings) getStubSettings()).createMembershipSettings(); + } + + /** Returns the object with the settings used for calls to deleteMembership. */ + public UnaryCallSettings deleteMembershipSettings() { + return ((ChatServiceStubSettings) getStubSettings()).deleteMembershipSettings(); + } + + /** Returns the object with the settings used for calls to createReaction. */ + public UnaryCallSettings createReactionSettings() { + return ((ChatServiceStubSettings) getStubSettings()).createReactionSettings(); + } + + /** Returns the object with the settings used for calls to listReactions. */ + public PagedCallSettings + listReactionsSettings() { + return ((ChatServiceStubSettings) getStubSettings()).listReactionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteReaction. */ + public UnaryCallSettings deleteReactionSettings() { + return ((ChatServiceStubSettings) getStubSettings()).deleteReactionSettings(); + } + + public static final ChatServiceSettings create(ChatServiceStubSettings stub) throws IOException { + return new ChatServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ChatServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ChatServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ChatServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ChatServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ChatServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ChatServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ChatServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ChatServiceStubSettings.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 ChatServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ChatServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ChatServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ChatServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ChatServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ChatServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ChatServiceStubSettings.newHttpJsonBuilder()); + } + + public ChatServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ChatServiceStubSettings.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 createMessage. */ + public UnaryCallSettings.Builder createMessageSettings() { + return getStubSettingsBuilder().createMessageSettings(); + } + + /** Returns the builder for the settings used for calls to listMessages. */ + public PagedCallSettings.Builder< + ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse> + listMessagesSettings() { + return getStubSettingsBuilder().listMessagesSettings(); + } + + /** Returns the builder for the settings used for calls to listMemberships. */ + public PagedCallSettings.Builder< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> + listMembershipsSettings() { + return getStubSettingsBuilder().listMembershipsSettings(); + } + + /** Returns the builder for the settings used for calls to getMembership. */ + public UnaryCallSettings.Builder getMembershipSettings() { + return getStubSettingsBuilder().getMembershipSettings(); + } + + /** Returns the builder for the settings used for calls to getMessage. */ + public UnaryCallSettings.Builder getMessageSettings() { + return getStubSettingsBuilder().getMessageSettings(); + } + + /** Returns the builder for the settings used for calls to updateMessage. */ + public UnaryCallSettings.Builder updateMessageSettings() { + return getStubSettingsBuilder().updateMessageSettings(); + } + + /** Returns the builder for the settings used for calls to deleteMessage. */ + public UnaryCallSettings.Builder deleteMessageSettings() { + return getStubSettingsBuilder().deleteMessageSettings(); + } + + /** Returns the builder for the settings used for calls to getAttachment. */ + public UnaryCallSettings.Builder getAttachmentSettings() { + return getStubSettingsBuilder().getAttachmentSettings(); + } + + /** Returns the builder for the settings used for calls to uploadAttachment. */ + public UnaryCallSettings.Builder + uploadAttachmentSettings() { + return getStubSettingsBuilder().uploadAttachmentSettings(); + } + + /** Returns the builder for the settings used for calls to listSpaces. */ + public PagedCallSettings.Builder + listSpacesSettings() { + return getStubSettingsBuilder().listSpacesSettings(); + } + + /** Returns the builder for the settings used for calls to getSpace. */ + public UnaryCallSettings.Builder getSpaceSettings() { + return getStubSettingsBuilder().getSpaceSettings(); + } + + /** Returns the builder for the settings used for calls to createSpace. */ + public UnaryCallSettings.Builder createSpaceSettings() { + return getStubSettingsBuilder().createSpaceSettings(); + } + + /** Returns the builder for the settings used for calls to setUpSpace. */ + public UnaryCallSettings.Builder setUpSpaceSettings() { + return getStubSettingsBuilder().setUpSpaceSettings(); + } + + /** Returns the builder for the settings used for calls to updateSpace. */ + public UnaryCallSettings.Builder updateSpaceSettings() { + return getStubSettingsBuilder().updateSpaceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSpace. */ + public UnaryCallSettings.Builder deleteSpaceSettings() { + return getStubSettingsBuilder().deleteSpaceSettings(); + } + + /** Returns the builder for the settings used for calls to completeImportSpace. */ + public UnaryCallSettings.Builder + completeImportSpaceSettings() { + return getStubSettingsBuilder().completeImportSpaceSettings(); + } + + /** Returns the builder for the settings used for calls to findDirectMessage. */ + public UnaryCallSettings.Builder findDirectMessageSettings() { + return getStubSettingsBuilder().findDirectMessageSettings(); + } + + /** Returns the builder for the settings used for calls to createMembership. */ + public UnaryCallSettings.Builder + createMembershipSettings() { + return getStubSettingsBuilder().createMembershipSettings(); + } + + /** Returns the builder for the settings used for calls to deleteMembership. */ + public UnaryCallSettings.Builder + deleteMembershipSettings() { + return getStubSettingsBuilder().deleteMembershipSettings(); + } + + /** Returns the builder for the settings used for calls to createReaction. */ + public UnaryCallSettings.Builder createReactionSettings() { + return getStubSettingsBuilder().createReactionSettings(); + } + + /** Returns the builder for the settings used for calls to listReactions. */ + public PagedCallSettings.Builder< + ListReactionsRequest, ListReactionsResponse, ListReactionsPagedResponse> + listReactionsSettings() { + return getStubSettingsBuilder().listReactionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteReaction. */ + public UnaryCallSettings.Builder deleteReactionSettings() { + return getStubSettingsBuilder().deleteReactionSettings(); + } + + @Override + public ChatServiceSettings build() throws IOException { + return new ChatServiceSettings(this); + } + } +} diff --git a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/gapic_metadata.json b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/gapic_metadata.json new file mode 100644 index 000000000000..edd5288bb690 --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/gapic_metadata.json @@ -0,0 +1,84 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.chat.v1", + "libraryPackage": "com.google.chat.v1", + "services": { + "ChatService": { + "clients": { + "grpc": { + "libraryClient": "ChatServiceClient", + "rpcs": { + "CompleteImportSpace": { + "methods": ["completeImportSpace", "completeImportSpaceCallable"] + }, + "CreateMembership": { + "methods": ["createMembership", "createMembership", "createMembership", "createMembershipCallable"] + }, + "CreateMessage": { + "methods": ["createMessage", "createMessage", "createMessage", "createMessageCallable"] + }, + "CreateReaction": { + "methods": ["createReaction", "createReaction", "createReaction", "createReactionCallable"] + }, + "CreateSpace": { + "methods": ["createSpace", "createSpace", "createSpaceCallable"] + }, + "DeleteMembership": { + "methods": ["deleteMembership", "deleteMembership", "deleteMembership", "deleteMembershipCallable"] + }, + "DeleteMessage": { + "methods": ["deleteMessage", "deleteMessage", "deleteMessage", "deleteMessageCallable"] + }, + "DeleteReaction": { + "methods": ["deleteReaction", "deleteReaction", "deleteReaction", "deleteReactionCallable"] + }, + "DeleteSpace": { + "methods": ["deleteSpace", "deleteSpace", "deleteSpace", "deleteSpaceCallable"] + }, + "FindDirectMessage": { + "methods": ["findDirectMessage", "findDirectMessageCallable"] + }, + "GetAttachment": { + "methods": ["getAttachment", "getAttachment", "getAttachment", "getAttachmentCallable"] + }, + "GetMembership": { + "methods": ["getMembership", "getMembership", "getMembership", "getMembershipCallable"] + }, + "GetMessage": { + "methods": ["getMessage", "getMessage", "getMessage", "getMessageCallable"] + }, + "GetSpace": { + "methods": ["getSpace", "getSpace", "getSpace", "getSpaceCallable"] + }, + "ListMemberships": { + "methods": ["listMemberships", "listMemberships", "listMemberships", "listMembershipsPagedCallable", "listMembershipsCallable"] + }, + "ListMessages": { + "methods": ["listMessages", "listMessages", "listMessages", "listMessagesPagedCallable", "listMessagesCallable"] + }, + "ListReactions": { + "methods": ["listReactions", "listReactions", "listReactions", "listReactionsPagedCallable", "listReactionsCallable"] + }, + "ListSpaces": { + "methods": ["listSpaces", "listSpaces", "listSpacesPagedCallable", "listSpacesCallable"] + }, + "SetUpSpace": { + "methods": ["setUpSpace", "setUpSpaceCallable"] + }, + "UpdateMessage": { + "methods": ["updateMessage", "updateMessage", "updateMessageCallable"] + }, + "UpdateSpace": { + "methods": ["updateSpace", "updateSpace", "updateSpaceCallable"] + }, + "UploadAttachment": { + "methods": ["uploadAttachment", "uploadAttachmentCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/package-info.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/package-info.java new file mode 100644 index 000000000000..7325732c5a16 --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/package-info.java @@ -0,0 +1,46 @@ +/* + * 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 Chat API + * + *

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

======================= ChatServiceClient ======================= + * + *

Service Description: Enables developers to build Chat apps and integrations on Google Chat + * Platform. + * + *

Sample for ChatServiceClient: + * + *

{@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 (ChatServiceClient chatServiceClient = ChatServiceClient.create()) {
+ *   SpaceName parent = SpaceName.of("[SPACE]");
+ *   Message message = Message.newBuilder().build();
+ *   String messageId = "messageId-1440013438";
+ *   Message response = chatServiceClient.createMessage(parent, message, messageId);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.chat.v1; + +import javax.annotation.Generated; diff --git a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/ChatServiceStub.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/ChatServiceStub.java new file mode 100644 index 000000000000..32142b905e11 --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/ChatServiceStub.java @@ -0,0 +1,181 @@ +/* + * 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.chat.v1.stub; + +import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.chat.v1.Attachment; +import com.google.chat.v1.CompleteImportSpaceRequest; +import com.google.chat.v1.CompleteImportSpaceResponse; +import com.google.chat.v1.CreateMembershipRequest; +import com.google.chat.v1.CreateMessageRequest; +import com.google.chat.v1.CreateReactionRequest; +import com.google.chat.v1.CreateSpaceRequest; +import com.google.chat.v1.DeleteMembershipRequest; +import com.google.chat.v1.DeleteMessageRequest; +import com.google.chat.v1.DeleteReactionRequest; +import com.google.chat.v1.DeleteSpaceRequest; +import com.google.chat.v1.FindDirectMessageRequest; +import com.google.chat.v1.GetAttachmentRequest; +import com.google.chat.v1.GetMembershipRequest; +import com.google.chat.v1.GetMessageRequest; +import com.google.chat.v1.GetSpaceRequest; +import com.google.chat.v1.ListMembershipsRequest; +import com.google.chat.v1.ListMembershipsResponse; +import com.google.chat.v1.ListMessagesRequest; +import com.google.chat.v1.ListMessagesResponse; +import com.google.chat.v1.ListReactionsRequest; +import com.google.chat.v1.ListReactionsResponse; +import com.google.chat.v1.ListSpacesRequest; +import com.google.chat.v1.ListSpacesResponse; +import com.google.chat.v1.Membership; +import com.google.chat.v1.Message; +import com.google.chat.v1.Reaction; +import com.google.chat.v1.SetUpSpaceRequest; +import com.google.chat.v1.Space; +import com.google.chat.v1.UpdateMessageRequest; +import com.google.chat.v1.UpdateSpaceRequest; +import com.google.chat.v1.UploadAttachmentRequest; +import com.google.chat.v1.UploadAttachmentResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ChatService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ChatServiceStub implements BackgroundResource { + + public UnaryCallable createMessageCallable() { + throw new UnsupportedOperationException("Not implemented: createMessageCallable()"); + } + + public UnaryCallable listMessagesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listMessagesPagedCallable()"); + } + + public UnaryCallable listMessagesCallable() { + throw new UnsupportedOperationException("Not implemented: listMessagesCallable()"); + } + + public UnaryCallable + listMembershipsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listMembershipsPagedCallable()"); + } + + public UnaryCallable listMembershipsCallable() { + throw new UnsupportedOperationException("Not implemented: listMembershipsCallable()"); + } + + public UnaryCallable getMembershipCallable() { + throw new UnsupportedOperationException("Not implemented: getMembershipCallable()"); + } + + public UnaryCallable getMessageCallable() { + throw new UnsupportedOperationException("Not implemented: getMessageCallable()"); + } + + public UnaryCallable updateMessageCallable() { + throw new UnsupportedOperationException("Not implemented: updateMessageCallable()"); + } + + public UnaryCallable deleteMessageCallable() { + throw new UnsupportedOperationException("Not implemented: deleteMessageCallable()"); + } + + public UnaryCallable getAttachmentCallable() { + throw new UnsupportedOperationException("Not implemented: getAttachmentCallable()"); + } + + public UnaryCallable + uploadAttachmentCallable() { + throw new UnsupportedOperationException("Not implemented: uploadAttachmentCallable()"); + } + + public UnaryCallable listSpacesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSpacesPagedCallable()"); + } + + public UnaryCallable listSpacesCallable() { + throw new UnsupportedOperationException("Not implemented: listSpacesCallable()"); + } + + public UnaryCallable getSpaceCallable() { + throw new UnsupportedOperationException("Not implemented: getSpaceCallable()"); + } + + public UnaryCallable createSpaceCallable() { + throw new UnsupportedOperationException("Not implemented: createSpaceCallable()"); + } + + public UnaryCallable setUpSpaceCallable() { + throw new UnsupportedOperationException("Not implemented: setUpSpaceCallable()"); + } + + public UnaryCallable updateSpaceCallable() { + throw new UnsupportedOperationException("Not implemented: updateSpaceCallable()"); + } + + public UnaryCallable deleteSpaceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSpaceCallable()"); + } + + public UnaryCallable + completeImportSpaceCallable() { + throw new UnsupportedOperationException("Not implemented: completeImportSpaceCallable()"); + } + + public UnaryCallable findDirectMessageCallable() { + throw new UnsupportedOperationException("Not implemented: findDirectMessageCallable()"); + } + + public UnaryCallable createMembershipCallable() { + throw new UnsupportedOperationException("Not implemented: createMembershipCallable()"); + } + + public UnaryCallable deleteMembershipCallable() { + throw new UnsupportedOperationException("Not implemented: deleteMembershipCallable()"); + } + + public UnaryCallable createReactionCallable() { + throw new UnsupportedOperationException("Not implemented: createReactionCallable()"); + } + + public UnaryCallable + listReactionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listReactionsPagedCallable()"); + } + + public UnaryCallable listReactionsCallable() { + throw new UnsupportedOperationException("Not implemented: listReactionsCallable()"); + } + + public UnaryCallable deleteReactionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteReactionCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/ChatServiceStubSettings.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/ChatServiceStubSettings.java new file mode 100644 index 000000000000..ea5533ea1c3a --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/ChatServiceStubSettings.java @@ -0,0 +1,1124 @@ +/* + * 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.chat.v1.stub; + +import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.chat.v1.Attachment; +import com.google.chat.v1.CompleteImportSpaceRequest; +import com.google.chat.v1.CompleteImportSpaceResponse; +import com.google.chat.v1.CreateMembershipRequest; +import com.google.chat.v1.CreateMessageRequest; +import com.google.chat.v1.CreateReactionRequest; +import com.google.chat.v1.CreateSpaceRequest; +import com.google.chat.v1.DeleteMembershipRequest; +import com.google.chat.v1.DeleteMessageRequest; +import com.google.chat.v1.DeleteReactionRequest; +import com.google.chat.v1.DeleteSpaceRequest; +import com.google.chat.v1.FindDirectMessageRequest; +import com.google.chat.v1.GetAttachmentRequest; +import com.google.chat.v1.GetMembershipRequest; +import com.google.chat.v1.GetMessageRequest; +import com.google.chat.v1.GetSpaceRequest; +import com.google.chat.v1.ListMembershipsRequest; +import com.google.chat.v1.ListMembershipsResponse; +import com.google.chat.v1.ListMessagesRequest; +import com.google.chat.v1.ListMessagesResponse; +import com.google.chat.v1.ListReactionsRequest; +import com.google.chat.v1.ListReactionsResponse; +import com.google.chat.v1.ListSpacesRequest; +import com.google.chat.v1.ListSpacesResponse; +import com.google.chat.v1.Membership; +import com.google.chat.v1.Message; +import com.google.chat.v1.Reaction; +import com.google.chat.v1.SetUpSpaceRequest; +import com.google.chat.v1.Space; +import com.google.chat.v1.UpdateMessageRequest; +import com.google.chat.v1.UpdateSpaceRequest; +import com.google.chat.v1.UploadAttachmentRequest; +import com.google.chat.v1.UploadAttachmentResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import 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 ChatServiceStub}. + * + *

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

    + *
  • The default service address (chat.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 createMessage 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
+ * ChatServiceStubSettings.Builder chatServiceSettingsBuilder =
+ *     ChatServiceStubSettings.newBuilder();
+ * chatServiceSettingsBuilder
+ *     .createMessageSettings()
+ *     .setRetrySettings(
+ *         chatServiceSettingsBuilder
+ *             .createMessageSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ChatServiceStubSettings chatServiceSettings = chatServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ChatServiceStubSettings 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.delete") + .add("https://www.googleapis.com/auth/chat.import") + .add("https://www.googleapis.com/auth/chat.memberships") + .add("https://www.googleapis.com/auth/chat.memberships.app") + .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.create") + .add("https://www.googleapis.com/auth/chat.messages.reactions") + .add("https://www.googleapis.com/auth/chat.messages.reactions.create") + .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.create") + .add("https://www.googleapis.com/auth/chat.spaces.readonly") + .build(); + + private final UnaryCallSettings createMessageSettings; + private final PagedCallSettings< + ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse> + listMessagesSettings; + private final PagedCallSettings< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> + listMembershipsSettings; + private final UnaryCallSettings getMembershipSettings; + private final UnaryCallSettings getMessageSettings; + private final UnaryCallSettings updateMessageSettings; + private final UnaryCallSettings deleteMessageSettings; + private final UnaryCallSettings getAttachmentSettings; + private final UnaryCallSettings + uploadAttachmentSettings; + private final PagedCallSettings + listSpacesSettings; + private final UnaryCallSettings getSpaceSettings; + private final UnaryCallSettings createSpaceSettings; + private final UnaryCallSettings setUpSpaceSettings; + private final UnaryCallSettings updateSpaceSettings; + private final UnaryCallSettings deleteSpaceSettings; + private final UnaryCallSettings + completeImportSpaceSettings; + private final UnaryCallSettings findDirectMessageSettings; + private final UnaryCallSettings createMembershipSettings; + private final UnaryCallSettings deleteMembershipSettings; + private final UnaryCallSettings createReactionSettings; + private final PagedCallSettings< + ListReactionsRequest, ListReactionsResponse, ListReactionsPagedResponse> + listReactionsSettings; + private final UnaryCallSettings deleteReactionSettings; + + private static final PagedListDescriptor + LIST_MESSAGES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListMessagesRequest injectToken(ListMessagesRequest payload, String token) { + return ListMessagesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListMessagesRequest injectPageSize(ListMessagesRequest payload, int pageSize) { + return ListMessagesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListMessagesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListMessagesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListMessagesResponse payload) { + return payload.getMessagesList() == null + ? ImmutableList.of() + : payload.getMessagesList(); + } + }; + + private static final PagedListDescriptor< + ListMembershipsRequest, ListMembershipsResponse, Membership> + LIST_MEMBERSHIPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListMembershipsRequest injectToken( + ListMembershipsRequest payload, String token) { + return ListMembershipsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListMembershipsRequest injectPageSize( + ListMembershipsRequest payload, int pageSize) { + return ListMembershipsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListMembershipsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListMembershipsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListMembershipsResponse payload) { + return payload.getMembershipsList() == null + ? ImmutableList.of() + : payload.getMembershipsList(); + } + }; + + private static final PagedListDescriptor + LIST_SPACES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSpacesRequest injectToken(ListSpacesRequest payload, String token) { + return ListSpacesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSpacesRequest injectPageSize(ListSpacesRequest payload, int pageSize) { + return ListSpacesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSpacesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSpacesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSpacesResponse payload) { + return payload.getSpacesList() == null + ? ImmutableList.of() + : payload.getSpacesList(); + } + }; + + private static final PagedListDescriptor + LIST_REACTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListReactionsRequest injectToken(ListReactionsRequest payload, String token) { + return ListReactionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListReactionsRequest injectPageSize(ListReactionsRequest payload, int pageSize) { + return ListReactionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListReactionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListReactionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListReactionsResponse payload) { + return payload.getReactionsList() == null + ? ImmutableList.of() + : payload.getReactionsList(); + } + }; + + private static final PagedListResponseFactory< + ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse> + LIST_MESSAGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListMessagesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_MESSAGES_PAGE_STR_DESC, request, context); + return ListMessagesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> + LIST_MEMBERSHIPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListMembershipsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_MEMBERSHIPS_PAGE_STR_DESC, request, context); + return ListMembershipsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSpacesRequest, ListSpacesResponse, ListSpacesPagedResponse> + LIST_SPACES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSpacesRequest, ListSpacesResponse, ListSpacesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSpacesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SPACES_PAGE_STR_DESC, request, context); + return ListSpacesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListReactionsRequest, ListReactionsResponse, ListReactionsPagedResponse> + LIST_REACTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListReactionsRequest, ListReactionsResponse, ListReactionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListReactionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REACTIONS_PAGE_STR_DESC, request, context); + return ListReactionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createMessage. */ + public UnaryCallSettings createMessageSettings() { + return createMessageSettings; + } + + /** Returns the object with the settings used for calls to listMessages. */ + public PagedCallSettings + listMessagesSettings() { + return listMessagesSettings; + } + + /** Returns the object with the settings used for calls to listMemberships. */ + public PagedCallSettings< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> + listMembershipsSettings() { + return listMembershipsSettings; + } + + /** Returns the object with the settings used for calls to getMembership. */ + public UnaryCallSettings getMembershipSettings() { + return getMembershipSettings; + } + + /** Returns the object with the settings used for calls to getMessage. */ + public UnaryCallSettings getMessageSettings() { + return getMessageSettings; + } + + /** Returns the object with the settings used for calls to updateMessage. */ + public UnaryCallSettings updateMessageSettings() { + return updateMessageSettings; + } + + /** Returns the object with the settings used for calls to deleteMessage. */ + public UnaryCallSettings deleteMessageSettings() { + return deleteMessageSettings; + } + + /** Returns the object with the settings used for calls to getAttachment. */ + public UnaryCallSettings getAttachmentSettings() { + return getAttachmentSettings; + } + + /** Returns the object with the settings used for calls to uploadAttachment. */ + public UnaryCallSettings + uploadAttachmentSettings() { + return uploadAttachmentSettings; + } + + /** Returns the object with the settings used for calls to listSpaces. */ + public PagedCallSettings + listSpacesSettings() { + return listSpacesSettings; + } + + /** Returns the object with the settings used for calls to getSpace. */ + public UnaryCallSettings getSpaceSettings() { + return getSpaceSettings; + } + + /** Returns the object with the settings used for calls to createSpace. */ + public UnaryCallSettings createSpaceSettings() { + return createSpaceSettings; + } + + /** Returns the object with the settings used for calls to setUpSpace. */ + public UnaryCallSettings setUpSpaceSettings() { + return setUpSpaceSettings; + } + + /** Returns the object with the settings used for calls to updateSpace. */ + public UnaryCallSettings updateSpaceSettings() { + return updateSpaceSettings; + } + + /** Returns the object with the settings used for calls to deleteSpace. */ + public UnaryCallSettings deleteSpaceSettings() { + return deleteSpaceSettings; + } + + /** Returns the object with the settings used for calls to completeImportSpace. */ + public UnaryCallSettings + completeImportSpaceSettings() { + return completeImportSpaceSettings; + } + + /** Returns the object with the settings used for calls to findDirectMessage. */ + public UnaryCallSettings findDirectMessageSettings() { + return findDirectMessageSettings; + } + + /** Returns the object with the settings used for calls to createMembership. */ + public UnaryCallSettings createMembershipSettings() { + return createMembershipSettings; + } + + /** Returns the object with the settings used for calls to deleteMembership. */ + public UnaryCallSettings deleteMembershipSettings() { + return deleteMembershipSettings; + } + + /** Returns the object with the settings used for calls to createReaction. */ + public UnaryCallSettings createReactionSettings() { + return createReactionSettings; + } + + /** Returns the object with the settings used for calls to listReactions. */ + public PagedCallSettings + listReactionsSettings() { + return listReactionsSettings; + } + + /** Returns the object with the settings used for calls to deleteReaction. */ + public UnaryCallSettings deleteReactionSettings() { + return deleteReactionSettings; + } + + public ChatServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcChatServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonChatServiceStub.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 "chat"; + } + + /** 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 "chat.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "chat.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(ChatServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ChatServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ChatServiceStubSettings.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 ChatServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createMessageSettings = settingsBuilder.createMessageSettings().build(); + listMessagesSettings = settingsBuilder.listMessagesSettings().build(); + listMembershipsSettings = settingsBuilder.listMembershipsSettings().build(); + getMembershipSettings = settingsBuilder.getMembershipSettings().build(); + getMessageSettings = settingsBuilder.getMessageSettings().build(); + updateMessageSettings = settingsBuilder.updateMessageSettings().build(); + deleteMessageSettings = settingsBuilder.deleteMessageSettings().build(); + getAttachmentSettings = settingsBuilder.getAttachmentSettings().build(); + uploadAttachmentSettings = settingsBuilder.uploadAttachmentSettings().build(); + listSpacesSettings = settingsBuilder.listSpacesSettings().build(); + getSpaceSettings = settingsBuilder.getSpaceSettings().build(); + createSpaceSettings = settingsBuilder.createSpaceSettings().build(); + setUpSpaceSettings = settingsBuilder.setUpSpaceSettings().build(); + updateSpaceSettings = settingsBuilder.updateSpaceSettings().build(); + deleteSpaceSettings = settingsBuilder.deleteSpaceSettings().build(); + completeImportSpaceSettings = settingsBuilder.completeImportSpaceSettings().build(); + findDirectMessageSettings = settingsBuilder.findDirectMessageSettings().build(); + createMembershipSettings = settingsBuilder.createMembershipSettings().build(); + deleteMembershipSettings = settingsBuilder.deleteMembershipSettings().build(); + createReactionSettings = settingsBuilder.createReactionSettings().build(); + listReactionsSettings = settingsBuilder.listReactionsSettings().build(); + deleteReactionSettings = settingsBuilder.deleteReactionSettings().build(); + } + + /** Builder for ChatServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createMessageSettings; + private final PagedCallSettings.Builder< + ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse> + listMessagesSettings; + private final PagedCallSettings.Builder< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> + listMembershipsSettings; + private final UnaryCallSettings.Builder getMembershipSettings; + private final UnaryCallSettings.Builder getMessageSettings; + private final UnaryCallSettings.Builder updateMessageSettings; + private final UnaryCallSettings.Builder deleteMessageSettings; + private final UnaryCallSettings.Builder getAttachmentSettings; + private final UnaryCallSettings.Builder + uploadAttachmentSettings; + private final PagedCallSettings.Builder< + ListSpacesRequest, ListSpacesResponse, ListSpacesPagedResponse> + listSpacesSettings; + private final UnaryCallSettings.Builder getSpaceSettings; + private final UnaryCallSettings.Builder createSpaceSettings; + private final UnaryCallSettings.Builder setUpSpaceSettings; + private final UnaryCallSettings.Builder updateSpaceSettings; + private final UnaryCallSettings.Builder deleteSpaceSettings; + private final UnaryCallSettings.Builder + completeImportSpaceSettings; + private final UnaryCallSettings.Builder + findDirectMessageSettings; + private final UnaryCallSettings.Builder + createMembershipSettings; + private final UnaryCallSettings.Builder + deleteMembershipSettings; + private final UnaryCallSettings.Builder createReactionSettings; + private final PagedCallSettings.Builder< + ListReactionsRequest, ListReactionsResponse, ListReactionsPagedResponse> + listReactionsSettings; + private final UnaryCallSettings.Builder deleteReactionSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listMessagesSettings = PagedCallSettings.newBuilder(LIST_MESSAGES_PAGE_STR_FACT); + listMembershipsSettings = PagedCallSettings.newBuilder(LIST_MEMBERSHIPS_PAGE_STR_FACT); + getMembershipSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + uploadAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSpacesSettings = PagedCallSettings.newBuilder(LIST_SPACES_PAGE_STR_FACT); + getSpaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSpaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setUpSpaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSpaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSpaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + completeImportSpaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + findDirectMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createMembershipSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteMembershipSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createReactionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listReactionsSettings = PagedCallSettings.newBuilder(LIST_REACTIONS_PAGE_STR_FACT); + deleteReactionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createMessageSettings, + listMessagesSettings, + listMembershipsSettings, + getMembershipSettings, + getMessageSettings, + updateMessageSettings, + deleteMessageSettings, + getAttachmentSettings, + uploadAttachmentSettings, + listSpacesSettings, + getSpaceSettings, + createSpaceSettings, + setUpSpaceSettings, + updateSpaceSettings, + deleteSpaceSettings, + completeImportSpaceSettings, + findDirectMessageSettings, + createMembershipSettings, + deleteMembershipSettings, + createReactionSettings, + listReactionsSettings, + deleteReactionSettings); + initDefaults(this); + } + + protected Builder(ChatServiceStubSettings settings) { + super(settings); + + createMessageSettings = settings.createMessageSettings.toBuilder(); + listMessagesSettings = settings.listMessagesSettings.toBuilder(); + listMembershipsSettings = settings.listMembershipsSettings.toBuilder(); + getMembershipSettings = settings.getMembershipSettings.toBuilder(); + getMessageSettings = settings.getMessageSettings.toBuilder(); + updateMessageSettings = settings.updateMessageSettings.toBuilder(); + deleteMessageSettings = settings.deleteMessageSettings.toBuilder(); + getAttachmentSettings = settings.getAttachmentSettings.toBuilder(); + uploadAttachmentSettings = settings.uploadAttachmentSettings.toBuilder(); + listSpacesSettings = settings.listSpacesSettings.toBuilder(); + getSpaceSettings = settings.getSpaceSettings.toBuilder(); + createSpaceSettings = settings.createSpaceSettings.toBuilder(); + setUpSpaceSettings = settings.setUpSpaceSettings.toBuilder(); + updateSpaceSettings = settings.updateSpaceSettings.toBuilder(); + deleteSpaceSettings = settings.deleteSpaceSettings.toBuilder(); + completeImportSpaceSettings = settings.completeImportSpaceSettings.toBuilder(); + findDirectMessageSettings = settings.findDirectMessageSettings.toBuilder(); + createMembershipSettings = settings.createMembershipSettings.toBuilder(); + deleteMembershipSettings = settings.deleteMembershipSettings.toBuilder(); + createReactionSettings = settings.createReactionSettings.toBuilder(); + listReactionsSettings = settings.listReactionsSettings.toBuilder(); + deleteReactionSettings = settings.deleteReactionSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createMessageSettings, + listMessagesSettings, + listMembershipsSettings, + getMembershipSettings, + getMessageSettings, + updateMessageSettings, + deleteMessageSettings, + getAttachmentSettings, + uploadAttachmentSettings, + listSpacesSettings, + getSpaceSettings, + createSpaceSettings, + setUpSpaceSettings, + updateSpaceSettings, + deleteSpaceSettings, + completeImportSpaceSettings, + findDirectMessageSettings, + createMembershipSettings, + deleteMembershipSettings, + createReactionSettings, + listReactionsSettings, + deleteReactionSettings); + } + + 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 + .createMessageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listMessagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listMembershipsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getMembershipSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getMessageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateMessageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteMessageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .uploadAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listSpacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getSpaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createSpaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setUpSpaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateSpaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteSpaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .completeImportSpaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .findDirectMessageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createMembershipSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteMembershipSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createReactionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listReactionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteReactionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createMessage. */ + public UnaryCallSettings.Builder createMessageSettings() { + return createMessageSettings; + } + + /** Returns the builder for the settings used for calls to listMessages. */ + public PagedCallSettings.Builder< + ListMessagesRequest, ListMessagesResponse, ListMessagesPagedResponse> + listMessagesSettings() { + return listMessagesSettings; + } + + /** Returns the builder for the settings used for calls to listMemberships. */ + public PagedCallSettings.Builder< + ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> + listMembershipsSettings() { + return listMembershipsSettings; + } + + /** Returns the builder for the settings used for calls to getMembership. */ + public UnaryCallSettings.Builder getMembershipSettings() { + return getMembershipSettings; + } + + /** Returns the builder for the settings used for calls to getMessage. */ + public UnaryCallSettings.Builder getMessageSettings() { + return getMessageSettings; + } + + /** Returns the builder for the settings used for calls to updateMessage. */ + public UnaryCallSettings.Builder updateMessageSettings() { + return updateMessageSettings; + } + + /** Returns the builder for the settings used for calls to deleteMessage. */ + public UnaryCallSettings.Builder deleteMessageSettings() { + return deleteMessageSettings; + } + + /** Returns the builder for the settings used for calls to getAttachment. */ + public UnaryCallSettings.Builder getAttachmentSettings() { + return getAttachmentSettings; + } + + /** Returns the builder for the settings used for calls to uploadAttachment. */ + public UnaryCallSettings.Builder + uploadAttachmentSettings() { + return uploadAttachmentSettings; + } + + /** Returns the builder for the settings used for calls to listSpaces. */ + public PagedCallSettings.Builder + listSpacesSettings() { + return listSpacesSettings; + } + + /** Returns the builder for the settings used for calls to getSpace. */ + public UnaryCallSettings.Builder getSpaceSettings() { + return getSpaceSettings; + } + + /** Returns the builder for the settings used for calls to createSpace. */ + public UnaryCallSettings.Builder createSpaceSettings() { + return createSpaceSettings; + } + + /** Returns the builder for the settings used for calls to setUpSpace. */ + public UnaryCallSettings.Builder setUpSpaceSettings() { + return setUpSpaceSettings; + } + + /** Returns the builder for the settings used for calls to updateSpace. */ + public UnaryCallSettings.Builder updateSpaceSettings() { + return updateSpaceSettings; + } + + /** Returns the builder for the settings used for calls to deleteSpace. */ + public UnaryCallSettings.Builder deleteSpaceSettings() { + return deleteSpaceSettings; + } + + /** Returns the builder for the settings used for calls to completeImportSpace. */ + public UnaryCallSettings.Builder + completeImportSpaceSettings() { + return completeImportSpaceSettings; + } + + /** Returns the builder for the settings used for calls to findDirectMessage. */ + public UnaryCallSettings.Builder findDirectMessageSettings() { + return findDirectMessageSettings; + } + + /** Returns the builder for the settings used for calls to createMembership. */ + public UnaryCallSettings.Builder + createMembershipSettings() { + return createMembershipSettings; + } + + /** Returns the builder for the settings used for calls to deleteMembership. */ + public UnaryCallSettings.Builder + deleteMembershipSettings() { + return deleteMembershipSettings; + } + + /** Returns the builder for the settings used for calls to createReaction. */ + public UnaryCallSettings.Builder createReactionSettings() { + return createReactionSettings; + } + + /** Returns the builder for the settings used for calls to listReactions. */ + public PagedCallSettings.Builder< + ListReactionsRequest, ListReactionsResponse, ListReactionsPagedResponse> + listReactionsSettings() { + return listReactionsSettings; + } + + /** Returns the builder for the settings used for calls to deleteReaction. */ + public UnaryCallSettings.Builder deleteReactionSettings() { + return deleteReactionSettings; + } + + /** 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 ChatServiceStubSettings build() throws IOException { + return new ChatServiceStubSettings(this); + } + } +} diff --git a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/GrpcChatServiceCallableFactory.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/GrpcChatServiceCallableFactory.java new file mode 100644 index 000000000000..826e0b45ba28 --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/GrpcChatServiceCallableFactory.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.chat.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 ChatService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcChatServiceCallableFactory 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-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/GrpcChatServiceStub.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/GrpcChatServiceStub.java new file mode 100644 index 000000000000..675781b49eeb --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/GrpcChatServiceStub.java @@ -0,0 +1,824 @@ +/* + * 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.chat.v1.stub; + +import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.chat.v1.Attachment; +import com.google.chat.v1.CompleteImportSpaceRequest; +import com.google.chat.v1.CompleteImportSpaceResponse; +import com.google.chat.v1.CreateMembershipRequest; +import com.google.chat.v1.CreateMessageRequest; +import com.google.chat.v1.CreateReactionRequest; +import com.google.chat.v1.CreateSpaceRequest; +import com.google.chat.v1.DeleteMembershipRequest; +import com.google.chat.v1.DeleteMessageRequest; +import com.google.chat.v1.DeleteReactionRequest; +import com.google.chat.v1.DeleteSpaceRequest; +import com.google.chat.v1.FindDirectMessageRequest; +import com.google.chat.v1.GetAttachmentRequest; +import com.google.chat.v1.GetMembershipRequest; +import com.google.chat.v1.GetMessageRequest; +import com.google.chat.v1.GetSpaceRequest; +import com.google.chat.v1.ListMembershipsRequest; +import com.google.chat.v1.ListMembershipsResponse; +import com.google.chat.v1.ListMessagesRequest; +import com.google.chat.v1.ListMessagesResponse; +import com.google.chat.v1.ListReactionsRequest; +import com.google.chat.v1.ListReactionsResponse; +import com.google.chat.v1.ListSpacesRequest; +import com.google.chat.v1.ListSpacesResponse; +import com.google.chat.v1.Membership; +import com.google.chat.v1.Message; +import com.google.chat.v1.Reaction; +import com.google.chat.v1.SetUpSpaceRequest; +import com.google.chat.v1.Space; +import com.google.chat.v1.UpdateMessageRequest; +import com.google.chat.v1.UpdateSpaceRequest; +import com.google.chat.v1.UploadAttachmentRequest; +import com.google.chat.v1.UploadAttachmentResponse; +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 ChatService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcChatServiceStub extends ChatServiceStub { + private static final MethodDescriptor + createMessageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/CreateMessage") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateMessageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Message.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listMessagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/ListMessages") + .setRequestMarshaller(ProtoUtils.marshaller(ListMessagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListMessagesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listMembershipsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/ListMemberships") + .setRequestMarshaller( + ProtoUtils.marshaller(ListMembershipsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListMembershipsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getMembershipMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/GetMembership") + .setRequestMarshaller( + ProtoUtils.marshaller(GetMembershipRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Membership.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getMessageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/GetMessage") + .setRequestMarshaller(ProtoUtils.marshaller(GetMessageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Message.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateMessageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/UpdateMessage") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateMessageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Message.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteMessageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/DeleteMessage") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteMessageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAttachmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/GetAttachment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Attachment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + uploadAttachmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/UploadAttachment") + .setRequestMarshaller( + ProtoUtils.marshaller(UploadAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(UploadAttachmentResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSpacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/ListSpaces") + .setRequestMarshaller(ProtoUtils.marshaller(ListSpacesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListSpacesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getSpaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/GetSpace") + .setRequestMarshaller(ProtoUtils.marshaller(GetSpaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Space.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createSpaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/CreateSpace") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSpaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Space.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setUpSpaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/SetUpSpace") + .setRequestMarshaller(ProtoUtils.marshaller(SetUpSpaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Space.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateSpaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/UpdateSpace") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSpaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Space.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteSpaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/DeleteSpace") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSpaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + completeImportSpaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/CompleteImportSpace") + .setRequestMarshaller( + ProtoUtils.marshaller(CompleteImportSpaceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CompleteImportSpaceResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + findDirectMessageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/FindDirectMessage") + .setRequestMarshaller( + ProtoUtils.marshaller(FindDirectMessageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Space.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createMembershipMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/CreateMembership") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateMembershipRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Membership.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteMembershipMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/DeleteMembership") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteMembershipRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Membership.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createReactionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/CreateReaction") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateReactionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Reaction.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listReactionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/ListReactions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListReactionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListReactionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteReactionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.chat.v1.ChatService/DeleteReaction") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteReactionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable createMessageCallable; + private final UnaryCallable listMessagesCallable; + private final UnaryCallable + listMessagesPagedCallable; + private final UnaryCallable + listMembershipsCallable; + private final UnaryCallable + listMembershipsPagedCallable; + private final UnaryCallable getMembershipCallable; + private final UnaryCallable getMessageCallable; + private final UnaryCallable updateMessageCallable; + private final UnaryCallable deleteMessageCallable; + private final UnaryCallable getAttachmentCallable; + private final UnaryCallable + uploadAttachmentCallable; + private final UnaryCallable listSpacesCallable; + private final UnaryCallable listSpacesPagedCallable; + private final UnaryCallable getSpaceCallable; + private final UnaryCallable createSpaceCallable; + private final UnaryCallable setUpSpaceCallable; + private final UnaryCallable updateSpaceCallable; + private final UnaryCallable deleteSpaceCallable; + private final UnaryCallable + completeImportSpaceCallable; + private final UnaryCallable findDirectMessageCallable; + private final UnaryCallable createMembershipCallable; + private final UnaryCallable deleteMembershipCallable; + private final UnaryCallable createReactionCallable; + private final UnaryCallable listReactionsCallable; + private final UnaryCallable + listReactionsPagedCallable; + private final UnaryCallable deleteReactionCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcChatServiceStub create(ChatServiceStubSettings settings) + throws IOException { + return new GrpcChatServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcChatServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcChatServiceStub(ChatServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcChatServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcChatServiceStub( + ChatServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcChatServiceStub, 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 GrpcChatServiceStub(ChatServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcChatServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcChatServiceStub, 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 GrpcChatServiceStub( + ChatServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createMessageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createMessageMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listMessagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMessagesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listMembershipsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMembershipsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getMembershipTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMembershipMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getMessageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMessageMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateMessageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMessageMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("message.name", String.valueOf(request.getMessage().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteMessageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMessageMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getAttachmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAttachmentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + uploadAttachmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(uploadAttachmentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSpacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSpacesMethodDescriptor) + .build(); + GrpcCallSettings getSpaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSpaceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createSpaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSpaceMethodDescriptor) + .build(); + GrpcCallSettings setUpSpaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setUpSpaceMethodDescriptor) + .build(); + GrpcCallSettings updateSpaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSpaceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("space.name", String.valueOf(request.getSpace().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteSpaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSpaceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + completeImportSpaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(completeImportSpaceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings findDirectMessageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(findDirectMessageMethodDescriptor) + .build(); + GrpcCallSettings createMembershipTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createMembershipMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteMembershipTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMembershipMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createReactionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createReactionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listReactionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listReactionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteReactionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteReactionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createMessageCallable = + callableFactory.createUnaryCallable( + createMessageTransportSettings, settings.createMessageSettings(), clientContext); + this.listMessagesCallable = + callableFactory.createUnaryCallable( + listMessagesTransportSettings, settings.listMessagesSettings(), clientContext); + this.listMessagesPagedCallable = + callableFactory.createPagedCallable( + listMessagesTransportSettings, settings.listMessagesSettings(), clientContext); + this.listMembershipsCallable = + callableFactory.createUnaryCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.listMembershipsPagedCallable = + callableFactory.createPagedCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.getMembershipCallable = + callableFactory.createUnaryCallable( + getMembershipTransportSettings, settings.getMembershipSettings(), clientContext); + this.getMessageCallable = + callableFactory.createUnaryCallable( + getMessageTransportSettings, settings.getMessageSettings(), clientContext); + this.updateMessageCallable = + callableFactory.createUnaryCallable( + updateMessageTransportSettings, settings.updateMessageSettings(), clientContext); + this.deleteMessageCallable = + callableFactory.createUnaryCallable( + deleteMessageTransportSettings, settings.deleteMessageSettings(), clientContext); + this.getAttachmentCallable = + callableFactory.createUnaryCallable( + getAttachmentTransportSettings, settings.getAttachmentSettings(), clientContext); + this.uploadAttachmentCallable = + callableFactory.createUnaryCallable( + uploadAttachmentTransportSettings, settings.uploadAttachmentSettings(), clientContext); + this.listSpacesCallable = + callableFactory.createUnaryCallable( + listSpacesTransportSettings, settings.listSpacesSettings(), clientContext); + this.listSpacesPagedCallable = + callableFactory.createPagedCallable( + listSpacesTransportSettings, settings.listSpacesSettings(), clientContext); + this.getSpaceCallable = + callableFactory.createUnaryCallable( + getSpaceTransportSettings, settings.getSpaceSettings(), clientContext); + this.createSpaceCallable = + callableFactory.createUnaryCallable( + createSpaceTransportSettings, settings.createSpaceSettings(), clientContext); + this.setUpSpaceCallable = + callableFactory.createUnaryCallable( + setUpSpaceTransportSettings, settings.setUpSpaceSettings(), clientContext); + this.updateSpaceCallable = + callableFactory.createUnaryCallable( + updateSpaceTransportSettings, settings.updateSpaceSettings(), clientContext); + this.deleteSpaceCallable = + callableFactory.createUnaryCallable( + deleteSpaceTransportSettings, settings.deleteSpaceSettings(), clientContext); + this.completeImportSpaceCallable = + callableFactory.createUnaryCallable( + completeImportSpaceTransportSettings, + settings.completeImportSpaceSettings(), + clientContext); + this.findDirectMessageCallable = + callableFactory.createUnaryCallable( + findDirectMessageTransportSettings, + settings.findDirectMessageSettings(), + clientContext); + this.createMembershipCallable = + callableFactory.createUnaryCallable( + createMembershipTransportSettings, settings.createMembershipSettings(), clientContext); + this.deleteMembershipCallable = + callableFactory.createUnaryCallable( + deleteMembershipTransportSettings, settings.deleteMembershipSettings(), clientContext); + this.createReactionCallable = + callableFactory.createUnaryCallable( + createReactionTransportSettings, settings.createReactionSettings(), clientContext); + this.listReactionsCallable = + callableFactory.createUnaryCallable( + listReactionsTransportSettings, settings.listReactionsSettings(), clientContext); + this.listReactionsPagedCallable = + callableFactory.createPagedCallable( + listReactionsTransportSettings, settings.listReactionsSettings(), clientContext); + this.deleteReactionCallable = + callableFactory.createUnaryCallable( + deleteReactionTransportSettings, settings.deleteReactionSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createMessageCallable() { + return createMessageCallable; + } + + @Override + public UnaryCallable listMessagesCallable() { + return listMessagesCallable; + } + + @Override + public UnaryCallable listMessagesPagedCallable() { + return listMessagesPagedCallable; + } + + @Override + public UnaryCallable listMembershipsCallable() { + return listMembershipsCallable; + } + + @Override + public UnaryCallable + listMembershipsPagedCallable() { + return listMembershipsPagedCallable; + } + + @Override + public UnaryCallable getMembershipCallable() { + return getMembershipCallable; + } + + @Override + public UnaryCallable getMessageCallable() { + return getMessageCallable; + } + + @Override + public UnaryCallable updateMessageCallable() { + return updateMessageCallable; + } + + @Override + public UnaryCallable deleteMessageCallable() { + return deleteMessageCallable; + } + + @Override + public UnaryCallable getAttachmentCallable() { + return getAttachmentCallable; + } + + @Override + public UnaryCallable + uploadAttachmentCallable() { + return uploadAttachmentCallable; + } + + @Override + public UnaryCallable listSpacesCallable() { + return listSpacesCallable; + } + + @Override + public UnaryCallable listSpacesPagedCallable() { + return listSpacesPagedCallable; + } + + @Override + public UnaryCallable getSpaceCallable() { + return getSpaceCallable; + } + + @Override + public UnaryCallable createSpaceCallable() { + return createSpaceCallable; + } + + @Override + public UnaryCallable setUpSpaceCallable() { + return setUpSpaceCallable; + } + + @Override + public UnaryCallable updateSpaceCallable() { + return updateSpaceCallable; + } + + @Override + public UnaryCallable deleteSpaceCallable() { + return deleteSpaceCallable; + } + + @Override + public UnaryCallable + completeImportSpaceCallable() { + return completeImportSpaceCallable; + } + + @Override + public UnaryCallable findDirectMessageCallable() { + return findDirectMessageCallable; + } + + @Override + public UnaryCallable createMembershipCallable() { + return createMembershipCallable; + } + + @Override + public UnaryCallable deleteMembershipCallable() { + return deleteMembershipCallable; + } + + @Override + public UnaryCallable createReactionCallable() { + return createReactionCallable; + } + + @Override + public UnaryCallable listReactionsCallable() { + return listReactionsCallable; + } + + @Override + public UnaryCallable + listReactionsPagedCallable() { + return listReactionsPagedCallable; + } + + @Override + public UnaryCallable deleteReactionCallable() { + return deleteReactionCallable; + } + + @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-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/HttpJsonChatServiceCallableFactory.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/HttpJsonChatServiceCallableFactory.java new file mode 100644 index 000000000000..6d28efb415fb --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/HttpJsonChatServiceCallableFactory.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.chat.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 ChatService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonChatServiceCallableFactory + 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-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/HttpJsonChatServiceStub.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/HttpJsonChatServiceStub.java new file mode 100644 index 000000000000..bfcd354e91e5 --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/stub/HttpJsonChatServiceStub.java @@ -0,0 +1,1467 @@ +/* + * 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.chat.v1.stub; + +import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.chat.v1.Attachment; +import com.google.chat.v1.CompleteImportSpaceRequest; +import com.google.chat.v1.CompleteImportSpaceResponse; +import com.google.chat.v1.CreateMembershipRequest; +import com.google.chat.v1.CreateMessageRequest; +import com.google.chat.v1.CreateReactionRequest; +import com.google.chat.v1.CreateSpaceRequest; +import com.google.chat.v1.DeleteMembershipRequest; +import com.google.chat.v1.DeleteMessageRequest; +import com.google.chat.v1.DeleteReactionRequest; +import com.google.chat.v1.DeleteSpaceRequest; +import com.google.chat.v1.FindDirectMessageRequest; +import com.google.chat.v1.GetAttachmentRequest; +import com.google.chat.v1.GetMembershipRequest; +import com.google.chat.v1.GetMessageRequest; +import com.google.chat.v1.GetSpaceRequest; +import com.google.chat.v1.ListMembershipsRequest; +import com.google.chat.v1.ListMembershipsResponse; +import com.google.chat.v1.ListMessagesRequest; +import com.google.chat.v1.ListMessagesResponse; +import com.google.chat.v1.ListReactionsRequest; +import com.google.chat.v1.ListReactionsResponse; +import com.google.chat.v1.ListSpacesRequest; +import com.google.chat.v1.ListSpacesResponse; +import com.google.chat.v1.Membership; +import com.google.chat.v1.Message; +import com.google.chat.v1.Reaction; +import com.google.chat.v1.SetUpSpaceRequest; +import com.google.chat.v1.Space; +import com.google.chat.v1.UpdateMessageRequest; +import com.google.chat.v1.UpdateSpaceRequest; +import com.google.chat.v1.UploadAttachmentRequest; +import com.google.chat.v1.UploadAttachmentResponse; +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 ChatService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonChatServiceStub extends ChatServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createMessageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/CreateMessage") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=spaces/*}/messages", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "messageId", request.getMessageId()); + serializer.putQueryParam( + fields, "messageReplyOption", request.getMessageReplyOptionValue()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "threadKey", request.getThreadKey()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("message", request.getMessage(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Message.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMessagesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/ListMessages") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=spaces/*}/messages", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam( + fields, "showDeleted", request.getShowDeleted()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListMessagesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMembershipsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/ListMemberships") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=spaces/*}/members", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "showGroups", request.getShowGroups()); + serializer.putQueryParam( + fields, "showInvited", request.getShowInvited()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListMembershipsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/GetMembership") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*/members/*}", + 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(Membership.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMessageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/GetMessage") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*/messages/*}", + 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(Message.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateMessageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/UpdateMessage") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{message.name=spaces/*/messages/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "message.name", request.getMessage().getName()); + return fields; + }) + .setAdditionalPaths("/v1/{message.name=spaces/*/messages/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("message", request.getMessage(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Message.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteMessageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/DeleteMessage") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*/messages/*}", + 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, "force", request.getForce()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/GetAttachment") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*/messages/*/attachments/*}", + 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(Attachment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + uploadAttachmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/UploadAttachment") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=spaces/*}/attachments:upload", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(UploadAttachmentResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSpacesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/ListSpaces") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/spaces", + 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(ListSpacesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getSpaceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/GetSpace") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*}", + 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(Space.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createSpaceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/CreateSpace") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/spaces", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("space", request.getSpace(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Space.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor setUpSpaceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/SetUpSpace") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/spaces:setup", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Space.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateSpaceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/UpdateSpace") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{space.name=spaces/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "space.name", request.getSpace().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("space", request.getSpace(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Space.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteSpaceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/DeleteSpace") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + completeImportSpaceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/CompleteImportSpace") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*}:completeImport", + 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(CompleteImportSpaceResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + findDirectMessageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/FindDirectMessage") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/spaces:findDirectMessage", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "name", request.getName()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Space.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/CreateMembership") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=spaces/*}/members", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("membership", request.getMembership(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Membership.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/DeleteMembership") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*/members/*}", + 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(Membership.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createReactionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/CreateReaction") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=spaces/*/messages/*}/reactions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("reaction", request.getReaction(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Reaction.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listReactionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/ListReactions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=spaces/*/messages/*}/reactions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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(ListReactionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteReactionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.chat.v1.ChatService/DeleteReaction") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=spaces/*/messages/*/reactions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createMessageCallable; + private final UnaryCallable listMessagesCallable; + private final UnaryCallable + listMessagesPagedCallable; + private final UnaryCallable + listMembershipsCallable; + private final UnaryCallable + listMembershipsPagedCallable; + private final UnaryCallable getMembershipCallable; + private final UnaryCallable getMessageCallable; + private final UnaryCallable updateMessageCallable; + private final UnaryCallable deleteMessageCallable; + private final UnaryCallable getAttachmentCallable; + private final UnaryCallable + uploadAttachmentCallable; + private final UnaryCallable listSpacesCallable; + private final UnaryCallable listSpacesPagedCallable; + private final UnaryCallable getSpaceCallable; + private final UnaryCallable createSpaceCallable; + private final UnaryCallable setUpSpaceCallable; + private final UnaryCallable updateSpaceCallable; + private final UnaryCallable deleteSpaceCallable; + private final UnaryCallable + completeImportSpaceCallable; + private final UnaryCallable findDirectMessageCallable; + private final UnaryCallable createMembershipCallable; + private final UnaryCallable deleteMembershipCallable; + private final UnaryCallable createReactionCallable; + private final UnaryCallable listReactionsCallable; + private final UnaryCallable + listReactionsPagedCallable; + private final UnaryCallable deleteReactionCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonChatServiceStub create(ChatServiceStubSettings settings) + throws IOException { + return new HttpJsonChatServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonChatServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonChatServiceStub( + ChatServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonChatServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonChatServiceStub( + ChatServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonChatServiceStub, 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 HttpJsonChatServiceStub(ChatServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonChatServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonChatServiceStub, 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 HttpJsonChatServiceStub( + ChatServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createMessageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createMessageMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listMessagesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMessagesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listMembershipsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMembershipsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getMessageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMessageMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateMessageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMessageMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("message.name", String.valueOf(request.getMessage().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteMessageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMessageMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAttachmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + uploadAttachmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(uploadAttachmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listSpacesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSpacesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getSpaceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSpaceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createSpaceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSpaceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setUpSpaceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setUpSpaceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateSpaceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSpaceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("space.name", String.valueOf(request.getSpace().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteSpaceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSpaceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + completeImportSpaceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(completeImportSpaceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings findDirectMessageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(findDirectMessageMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createReactionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createReactionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listReactionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listReactionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteReactionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteReactionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.createMessageCallable = + callableFactory.createUnaryCallable( + createMessageTransportSettings, settings.createMessageSettings(), clientContext); + this.listMessagesCallable = + callableFactory.createUnaryCallable( + listMessagesTransportSettings, settings.listMessagesSettings(), clientContext); + this.listMessagesPagedCallable = + callableFactory.createPagedCallable( + listMessagesTransportSettings, settings.listMessagesSettings(), clientContext); + this.listMembershipsCallable = + callableFactory.createUnaryCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.listMembershipsPagedCallable = + callableFactory.createPagedCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.getMembershipCallable = + callableFactory.createUnaryCallable( + getMembershipTransportSettings, settings.getMembershipSettings(), clientContext); + this.getMessageCallable = + callableFactory.createUnaryCallable( + getMessageTransportSettings, settings.getMessageSettings(), clientContext); + this.updateMessageCallable = + callableFactory.createUnaryCallable( + updateMessageTransportSettings, settings.updateMessageSettings(), clientContext); + this.deleteMessageCallable = + callableFactory.createUnaryCallable( + deleteMessageTransportSettings, settings.deleteMessageSettings(), clientContext); + this.getAttachmentCallable = + callableFactory.createUnaryCallable( + getAttachmentTransportSettings, settings.getAttachmentSettings(), clientContext); + this.uploadAttachmentCallable = + callableFactory.createUnaryCallable( + uploadAttachmentTransportSettings, settings.uploadAttachmentSettings(), clientContext); + this.listSpacesCallable = + callableFactory.createUnaryCallable( + listSpacesTransportSettings, settings.listSpacesSettings(), clientContext); + this.listSpacesPagedCallable = + callableFactory.createPagedCallable( + listSpacesTransportSettings, settings.listSpacesSettings(), clientContext); + this.getSpaceCallable = + callableFactory.createUnaryCallable( + getSpaceTransportSettings, settings.getSpaceSettings(), clientContext); + this.createSpaceCallable = + callableFactory.createUnaryCallable( + createSpaceTransportSettings, settings.createSpaceSettings(), clientContext); + this.setUpSpaceCallable = + callableFactory.createUnaryCallable( + setUpSpaceTransportSettings, settings.setUpSpaceSettings(), clientContext); + this.updateSpaceCallable = + callableFactory.createUnaryCallable( + updateSpaceTransportSettings, settings.updateSpaceSettings(), clientContext); + this.deleteSpaceCallable = + callableFactory.createUnaryCallable( + deleteSpaceTransportSettings, settings.deleteSpaceSettings(), clientContext); + this.completeImportSpaceCallable = + callableFactory.createUnaryCallable( + completeImportSpaceTransportSettings, + settings.completeImportSpaceSettings(), + clientContext); + this.findDirectMessageCallable = + callableFactory.createUnaryCallable( + findDirectMessageTransportSettings, + settings.findDirectMessageSettings(), + clientContext); + this.createMembershipCallable = + callableFactory.createUnaryCallable( + createMembershipTransportSettings, settings.createMembershipSettings(), clientContext); + this.deleteMembershipCallable = + callableFactory.createUnaryCallable( + deleteMembershipTransportSettings, settings.deleteMembershipSettings(), clientContext); + this.createReactionCallable = + callableFactory.createUnaryCallable( + createReactionTransportSettings, settings.createReactionSettings(), clientContext); + this.listReactionsCallable = + callableFactory.createUnaryCallable( + listReactionsTransportSettings, settings.listReactionsSettings(), clientContext); + this.listReactionsPagedCallable = + callableFactory.createPagedCallable( + listReactionsTransportSettings, settings.listReactionsSettings(), clientContext); + this.deleteReactionCallable = + callableFactory.createUnaryCallable( + deleteReactionTransportSettings, settings.deleteReactionSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createMessageMethodDescriptor); + methodDescriptors.add(listMessagesMethodDescriptor); + methodDescriptors.add(listMembershipsMethodDescriptor); + methodDescriptors.add(getMembershipMethodDescriptor); + methodDescriptors.add(getMessageMethodDescriptor); + methodDescriptors.add(updateMessageMethodDescriptor); + methodDescriptors.add(deleteMessageMethodDescriptor); + methodDescriptors.add(getAttachmentMethodDescriptor); + methodDescriptors.add(uploadAttachmentMethodDescriptor); + methodDescriptors.add(listSpacesMethodDescriptor); + methodDescriptors.add(getSpaceMethodDescriptor); + methodDescriptors.add(createSpaceMethodDescriptor); + methodDescriptors.add(setUpSpaceMethodDescriptor); + methodDescriptors.add(updateSpaceMethodDescriptor); + methodDescriptors.add(deleteSpaceMethodDescriptor); + methodDescriptors.add(completeImportSpaceMethodDescriptor); + methodDescriptors.add(findDirectMessageMethodDescriptor); + methodDescriptors.add(createMembershipMethodDescriptor); + methodDescriptors.add(deleteMembershipMethodDescriptor); + methodDescriptors.add(createReactionMethodDescriptor); + methodDescriptors.add(listReactionsMethodDescriptor); + methodDescriptors.add(deleteReactionMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createMessageCallable() { + return createMessageCallable; + } + + @Override + public UnaryCallable listMessagesCallable() { + return listMessagesCallable; + } + + @Override + public UnaryCallable listMessagesPagedCallable() { + return listMessagesPagedCallable; + } + + @Override + public UnaryCallable listMembershipsCallable() { + return listMembershipsCallable; + } + + @Override + public UnaryCallable + listMembershipsPagedCallable() { + return listMembershipsPagedCallable; + } + + @Override + public UnaryCallable getMembershipCallable() { + return getMembershipCallable; + } + + @Override + public UnaryCallable getMessageCallable() { + return getMessageCallable; + } + + @Override + public UnaryCallable updateMessageCallable() { + return updateMessageCallable; + } + + @Override + public UnaryCallable deleteMessageCallable() { + return deleteMessageCallable; + } + + @Override + public UnaryCallable getAttachmentCallable() { + return getAttachmentCallable; + } + + @Override + public UnaryCallable + uploadAttachmentCallable() { + return uploadAttachmentCallable; + } + + @Override + public UnaryCallable listSpacesCallable() { + return listSpacesCallable; + } + + @Override + public UnaryCallable listSpacesPagedCallable() { + return listSpacesPagedCallable; + } + + @Override + public UnaryCallable getSpaceCallable() { + return getSpaceCallable; + } + + @Override + public UnaryCallable createSpaceCallable() { + return createSpaceCallable; + } + + @Override + public UnaryCallable setUpSpaceCallable() { + return setUpSpaceCallable; + } + + @Override + public UnaryCallable updateSpaceCallable() { + return updateSpaceCallable; + } + + @Override + public UnaryCallable deleteSpaceCallable() { + return deleteSpaceCallable; + } + + @Override + public UnaryCallable + completeImportSpaceCallable() { + return completeImportSpaceCallable; + } + + @Override + public UnaryCallable findDirectMessageCallable() { + return findDirectMessageCallable; + } + + @Override + public UnaryCallable createMembershipCallable() { + return createMembershipCallable; + } + + @Override + public UnaryCallable deleteMembershipCallable() { + return deleteMembershipCallable; + } + + @Override + public UnaryCallable createReactionCallable() { + return createReactionCallable; + } + + @Override + public UnaryCallable listReactionsCallable() { + return listReactionsCallable; + } + + @Override + public UnaryCallable + listReactionsPagedCallable() { + return listReactionsPagedCallable; + } + + @Override + public UnaryCallable deleteReactionCallable() { + return deleteReactionCallable; + } + + @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-chat/google-cloud-chat/src/main/resources/META-INF/native-image/com.google.chat.v1/reflect-config.json b/java-chat/google-cloud-chat/src/main/resources/META-INF/native-image/com.google.chat.v1/reflect-config.json new file mode 100644 index 000000000000..32d17063436f --- /dev/null +++ b/java-chat/google-cloud-chat/src/main/resources/META-INF/native-image/com.google.chat.v1/reflect-config.json @@ -0,0 +1,3584 @@ +[ + { + "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.card.v1.Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Action$ActionParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Action$ActionParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Action$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Action$Interaction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Action$LoadIndicator", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.BorderStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.BorderStyle$BorderType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.BorderStyle$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Button", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Button$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.ButtonList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.ButtonList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$CardAction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$CardAction$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$CardFixedFooter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$CardFixedFooter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$CardHeader", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$CardHeader$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$DisplayStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$DividerStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$Section", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Card$Section$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns$Column", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns$Column$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns$Column$HorizontalSizeStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns$Column$VerticalAlignment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns$Column$Widgets", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Columns$Column$Widgets$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DateTimePicker", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DateTimePicker$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DateTimePicker$DateTimePickerType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DecoratedText", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DecoratedText$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DecoratedText$SwitchControl", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DecoratedText$SwitchControl$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.DecoratedText$SwitchControl$ControlType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Divider", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Divider$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Grid", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Grid$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Grid$GridItem", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Grid$GridItem$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Grid$GridItem$GridItemLayout", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Icon", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Icon$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Image", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Image$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.ImageComponent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.ImageComponent$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.ImageCropStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.ImageCropStyle$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.ImageCropStyle$ImageCropType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.OnClick", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.OnClick$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.OpenLink", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.OpenLink$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.OpenLink$OnClose", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.OpenLink$OpenAs", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput$PlatformDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput$PlatformDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput$PlatformDataSource$CommonDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput$SelectionItem", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput$SelectionItem$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.SelectionInput$SelectionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Suggestions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Suggestions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Suggestions$SuggestionItem", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Suggestions$SuggestionItem$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.TextInput", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.TextInput$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.TextInput$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.TextParagraph", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.TextParagraph$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Widget", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Widget$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Widget$HorizontalAlignment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.apps.card.v1.Widget$ImageType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionResponse$ResponseType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionResponse$SelectionItems", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionResponse$SelectionItems$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionResponse$UpdatedWidget", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionResponse$UpdatedWidget$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ActionStatus$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.AnnotationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.AttachedGif", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.AttachedGif$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Attachment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Attachment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Attachment$Source", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.AttachmentDataRef", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.AttachmentDataRef$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CardWithId", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CardWithId$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CompleteImportSpaceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CompleteImportSpaceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CompleteImportSpaceResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CompleteImportSpaceResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$CardAction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$CardAction$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$CardHeader", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$CardHeader$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$CardHeader$ImageStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$Section", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ContextualAddOnMarkup$Card$Section$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateMembershipRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateMembershipRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateMessageRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateMessageRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateMessageRequest$MessageReplyOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateReactionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateReactionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateSpaceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CreateSpaceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CustomEmoji", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.CustomEmoji$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteMembershipRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteMembershipRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteMessageRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteMessageRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteReactionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteReactionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteSpaceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeleteSpaceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeletionMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeletionMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DeletionMetadata$DeletionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Dialog", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Dialog$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DialogAction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DialogAction$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DriveDataRef", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DriveDataRef$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Emoji", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Emoji$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.EmojiReactionSummary", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.EmojiReactionSummary$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.FindDirectMessageRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.FindDirectMessageRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetAttachmentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetAttachmentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetMembershipRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetMembershipRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetMessageRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetMessageRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetSpaceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.GetSpaceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Group", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Group$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.HistoryState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMembershipsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMembershipsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMembershipsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMembershipsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMessagesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMessagesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMessagesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListMessagesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListReactionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListReactionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListReactionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListReactionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListSpacesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListSpacesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListSpacesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.ListSpacesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.MatchedUrl", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.MatchedUrl$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Membership", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Membership$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Membership$MembershipRole", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Membership$MembershipState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Message", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Message$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.QuotedMessageMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.QuotedMessageMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Reaction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Reaction$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.SetUpSpaceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.SetUpSpaceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.SlashCommand", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.SlashCommand$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.SlashCommandMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.SlashCommandMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.SlashCommandMetadata$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Space", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Space$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Space$SpaceDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Space$SpaceDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Space$SpaceThreadingState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Space$SpaceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Space$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Thread", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.Thread$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UpdateMessageRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UpdateMessageRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UpdateSpaceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UpdateSpaceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UploadAttachmentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UploadAttachmentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UploadAttachmentResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UploadAttachmentResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.User", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.User$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.User$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UserMentionMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UserMentionMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.UserMentionMetadata$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$Button", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$Button$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$FormAction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$FormAction$ActionParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$FormAction$ActionParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$FormAction$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$Icon", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$Image", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$Image$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$ImageButton", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$ImageButton$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$KeyValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$KeyValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$OnClick", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$OnClick$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$OpenLink", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$OpenLink$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$TextButton", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$TextButton$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$TextParagraph", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.WidgetMarkup$TextParagraph$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$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.DoubleValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue$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.FloatValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue$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.protobuf.UInt32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Code", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Color", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Color$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/ChatServiceClientHttpJsonTest.java b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/ChatServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..5bc966a57316 --- /dev/null +++ b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/ChatServiceClientHttpJsonTest.java @@ -0,0 +1,2007 @@ +/* + * 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.chat.v1; + +import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse; + +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.chat.v1.stub.HttpJsonChatServiceStub; +import com.google.common.collect.Lists; +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 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 ChatServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static ChatServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonChatServiceStub.getMethodDescriptors(), + ChatServiceSettings.getDefaultEndpoint()); + ChatServiceSettings settings = + ChatServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ChatServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ChatServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createMessageTest() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + + Message actualResponse = client.createMessage(parent, message, messageId); + 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 createMessageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + client.createMessage(parent, message, messageId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMessageTest2() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "spaces/space-3870"; + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + + Message actualResponse = client.createMessage(parent, message, messageId); + 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 createMessageExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "spaces/space-3870"; + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + client.createMessage(parent, message, messageId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMessagesTest() throws Exception { + Message responsesElement = Message.newBuilder().build(); + ListMessagesResponse expectedResponse = + ListMessagesResponse.newBuilder() + .setNextPageToken("") + .addAllMessages(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + + ListMessagesPagedResponse pagedListResponse = client.listMessages(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMessagesList().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 listMessagesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + client.listMessages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMessagesTest2() throws Exception { + Message responsesElement = Message.newBuilder().build(); + ListMessagesResponse expectedResponse = + ListMessagesResponse.newBuilder() + .setNextPageToken("") + .addAllMessages(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "spaces/space-3870"; + + ListMessagesPagedResponse pagedListResponse = client.listMessages(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMessagesList().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 listMessagesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "spaces/space-3870"; + client.listMessages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllMemberships(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMembershipsList().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 listMembershipsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest2() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllMemberships(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "spaces/space-3870"; + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMembershipsList().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 listMembershipsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "spaces/space-3870"; + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + + Membership actualResponse = client.getMembership(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 getMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-6456/members/member-6456"; + + Membership actualResponse = client.getMembership(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 getMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-6456/members/member-6456"; + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMessageTest() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + + Message actualResponse = client.getMessage(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 getMessageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + client.getMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMessageTest2() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-765/messages/message-765"; + + Message actualResponse = client.getMessage(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 getMessageExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-765/messages/message-765"; + client.getMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateMessageTest() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + Message message = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Message actualResponse = client.updateMessage(message, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateMessageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Message message = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateMessage(message, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMessageTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + + client.deleteMessage(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMessageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + client.deleteMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMessageTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-765/messages/message-765"; + + client.deleteMessage(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMessageExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-765/messages/message-765"; + client.deleteMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttachmentTest() throws Exception { + Attachment expectedResponse = + Attachment.newBuilder() + .setName(AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]").toString()) + .setContentName("contentName-389333340") + .setContentType("contentType-389131437") + .setThumbnailUri("thumbnailUri-356760352") + .setDownloadUri("downloadUri-1211148348") + .build(); + mockService.addResponse(expectedResponse); + + AttachmentName name = AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]"); + + Attachment actualResponse = client.getAttachment(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 getAttachmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AttachmentName name = AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]"); + client.getAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttachmentTest2() throws Exception { + Attachment expectedResponse = + Attachment.newBuilder() + .setName(AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]").toString()) + .setContentName("contentName-389333340") + .setContentType("contentType-389131437") + .setThumbnailUri("thumbnailUri-356760352") + .setDownloadUri("downloadUri-1211148348") + .build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-8657/messages/message-8657/attachments/attachment-8657"; + + Attachment actualResponse = client.getAttachment(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 getAttachmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-8657/messages/message-8657/attachments/attachment-8657"; + client.getAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void uploadAttachmentTest() throws Exception { + UploadAttachmentResponse expectedResponse = + UploadAttachmentResponse.newBuilder() + .setAttachmentDataRef(AttachmentDataRef.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UploadAttachmentRequest request = + UploadAttachmentRequest.newBuilder() + .setParent(SpaceName.of("[SPACE]").toString()) + .setFilename("filename-734768633") + .build(); + + UploadAttachmentResponse actualResponse = client.uploadAttachment(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void uploadAttachmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UploadAttachmentRequest request = + UploadAttachmentRequest.newBuilder() + .setParent(SpaceName.of("[SPACE]").toString()) + .setFilename("filename-734768633") + .build(); + client.uploadAttachment(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpacesTest() throws Exception { + Space responsesElement = Space.newBuilder().build(); + ListSpacesResponse expectedResponse = + ListSpacesResponse.newBuilder() + .setNextPageToken("") + .addAllSpaces(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListSpacesPagedResponse pagedListResponse = client.listSpaces(); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpacesList().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 listSpacesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListSpacesRequest request = + ListSpacesRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + client.listSpaces(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockService.addResponse(expectedResponse); + + SpaceName name = SpaceName.of("[SPACE]"); + + Space actualResponse = client.getSpace(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 getSpaceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpaceName name = SpaceName.of("[SPACE]"); + client.getSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpaceTest2() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-5469"; + + Space actualResponse = client.getSpace(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 getSpaceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-5469"; + client.getSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockService.addResponse(expectedResponse); + + Space space = Space.newBuilder().build(); + + Space actualResponse = client.createSpace(space); + 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 createSpaceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Space space = Space.newBuilder().build(); + client.createSpace(space); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setUpSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockService.addResponse(expectedResponse); + + SetUpSpaceRequest request = + SetUpSpaceRequest.newBuilder() + .setSpace(Space.newBuilder().build()) + .setRequestId("requestId693933066") + .addAllMemberships(new ArrayList()) + .build(); + + Space actualResponse = client.setUpSpace(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setUpSpaceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetUpSpaceRequest request = + SetUpSpaceRequest.newBuilder() + .setSpace(Space.newBuilder().build()) + .setRequestId("requestId693933066") + .addAllMemberships(new ArrayList()) + .build(); + client.setUpSpace(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockService.addResponse(expectedResponse); + + Space space = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Space actualResponse = client.updateSpace(space, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSpaceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Space space = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSpace(space, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpaceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SpaceName name = SpaceName.of("[SPACE]"); + + client.deleteSpace(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSpaceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpaceName name = SpaceName.of("[SPACE]"); + client.deleteSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpaceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-5469"; + + client.deleteSpace(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSpaceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-5469"; + client.deleteSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void completeImportSpaceTest() throws Exception { + CompleteImportSpaceResponse expectedResponse = + CompleteImportSpaceResponse.newBuilder().setSpace(Space.newBuilder().build()).build(); + mockService.addResponse(expectedResponse); + + CompleteImportSpaceRequest request = + CompleteImportSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build(); + + CompleteImportSpaceResponse actualResponse = client.completeImportSpace(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void completeImportSpaceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CompleteImportSpaceRequest request = + CompleteImportSpaceRequest.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .build(); + client.completeImportSpace(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void findDirectMessageTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockService.addResponse(expectedResponse); + + FindDirectMessageRequest request = + FindDirectMessageRequest.newBuilder().setName("name3373707").build(); + + Space actualResponse = client.findDirectMessage(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void findDirectMessageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FindDirectMessageRequest request = + FindDirectMessageRequest.newBuilder().setName("name3373707").build(); + client.findDirectMessage(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + Membership membership = Membership.newBuilder().build(); + + Membership actualResponse = client.createMembership(parent, membership); + 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 createMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + Membership membership = Membership.newBuilder().build(); + client.createMembership(parent, membership); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "spaces/space-3870"; + Membership membership = Membership.newBuilder().build(); + + Membership actualResponse = client.createMembership(parent, membership); + 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 createMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "spaces/space-3870"; + Membership membership = Membership.newBuilder().build(); + client.createMembership(parent, membership); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + + Membership actualResponse = client.deleteMembership(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 deleteMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + client.deleteMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-6456/members/member-6456"; + + Membership actualResponse = client.deleteMembership(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 deleteMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-6456/members/member-6456"; + client.deleteMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReactionTest() throws Exception { + Reaction expectedResponse = + Reaction.newBuilder() + .setName(ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]").toString()) + .setUser(User.newBuilder().build()) + .setEmoji(Emoji.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + Reaction reaction = Reaction.newBuilder().build(); + + Reaction actualResponse = client.createReaction(parent, reaction); + 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 createReactionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + Reaction reaction = Reaction.newBuilder().build(); + client.createReaction(parent, reaction); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReactionTest2() throws Exception { + Reaction expectedResponse = + Reaction.newBuilder() + .setName(ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]").toString()) + .setUser(User.newBuilder().build()) + .setEmoji(Emoji.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "spaces/space-8748/messages/message-8748"; + Reaction reaction = Reaction.newBuilder().build(); + + Reaction actualResponse = client.createReaction(parent, reaction); + 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 createReactionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "spaces/space-8748/messages/message-8748"; + Reaction reaction = Reaction.newBuilder().build(); + client.createReaction(parent, reaction); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReactionsTest() throws Exception { + Reaction responsesElement = Reaction.newBuilder().build(); + ListReactionsResponse expectedResponse = + ListReactionsResponse.newBuilder() + .setNextPageToken("") + .addAllReactions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + + ListReactionsPagedResponse pagedListResponse = client.listReactions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReactionsList().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 listReactionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + client.listReactions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReactionsTest2() throws Exception { + Reaction responsesElement = Reaction.newBuilder().build(); + ListReactionsResponse expectedResponse = + ListReactionsResponse.newBuilder() + .setNextPageToken("") + .addAllReactions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "spaces/space-8748/messages/message-8748"; + + ListReactionsPagedResponse pagedListResponse = client.listReactions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReactionsList().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 listReactionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "spaces/space-8748/messages/message-8748"; + client.listReactions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReactionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ReactionName name = ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]"); + + client.deleteReaction(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteReactionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReactionName name = ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]"); + client.deleteReaction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReactionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "spaces/space-9479/messages/message-9479/reactions/reaction-9479"; + + client.deleteReaction(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteReactionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "spaces/space-9479/messages/message-9479/reactions/reaction-9479"; + client.deleteReaction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/ChatServiceClientTest.java b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/ChatServiceClientTest.java new file mode 100644 index 000000000000..a67458e84863 --- /dev/null +++ b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/ChatServiceClientTest.java @@ -0,0 +1,1728 @@ +/* + * 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.chat.v1; + +import static com.google.chat.v1.ChatServiceClient.ListMembershipsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListMessagesPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListReactionsPagedResponse; +import static com.google.chat.v1.ChatServiceClient.ListSpacesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.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 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 ChatServiceClientTest { + private static MockChatService mockChatService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ChatServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockChatService = new MockChatService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockChatService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ChatServiceSettings settings = + ChatServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ChatServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createMessageTest() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockChatService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + + Message actualResponse = client.createMessage(parent, message, messageId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateMessageRequest actualRequest = ((CreateMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(messageId, actualRequest.getMessageId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createMessageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + client.createMessage(parent, message, messageId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMessageTest2() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockChatService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + + Message actualResponse = client.createMessage(parent, message, messageId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateMessageRequest actualRequest = ((CreateMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(messageId, actualRequest.getMessageId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createMessageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String parent = "parent-995424086"; + Message message = Message.newBuilder().build(); + String messageId = "messageId-1440013438"; + client.createMessage(parent, message, messageId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMessagesTest() throws Exception { + Message responsesElement = Message.newBuilder().build(); + ListMessagesResponse expectedResponse = + ListMessagesResponse.newBuilder() + .setNextPageToken("") + .addAllMessages(Arrays.asList(responsesElement)) + .build(); + mockChatService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + + ListMessagesPagedResponse pagedListResponse = client.listMessages(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMessagesList().get(0), resources.get(0)); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMessagesRequest actualRequest = ((ListMessagesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMessagesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + client.listMessages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMessagesTest2() throws Exception { + Message responsesElement = Message.newBuilder().build(); + ListMessagesResponse expectedResponse = + ListMessagesResponse.newBuilder() + .setNextPageToken("") + .addAllMessages(Arrays.asList(responsesElement)) + .build(); + mockChatService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListMessagesPagedResponse pagedListResponse = client.listMessages(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMessagesList().get(0), resources.get(0)); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMessagesRequest actualRequest = ((ListMessagesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMessagesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listMessages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllMemberships(Arrays.asList(responsesElement)) + .build(); + mockChatService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMembershipsList().get(0), resources.get(0)); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMembershipsRequest actualRequest = ((ListMembershipsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMembershipsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest2() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllMemberships(Arrays.asList(responsesElement)) + .build(); + mockChatService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMembershipsList().get(0), resources.get(0)); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMembershipsRequest actualRequest = ((ListMembershipsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMembershipsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMembershipRequest actualRequest = ((GetMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMembershipExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMembershipRequest actualRequest = ((GetMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMembershipExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMessageTest() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockChatService.addResponse(expectedResponse); + + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + + Message actualResponse = client.getMessage(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMessageRequest actualRequest = ((GetMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMessageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + client.getMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMessageTest2() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + Message actualResponse = client.getMessage(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMessageRequest actualRequest = ((GetMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMessageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.getMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateMessageTest() throws Exception { + Message expectedResponse = + Message.newBuilder() + .setName(MessageName.of("[SPACE]", "[MESSAGE]").toString()) + .setSender(User.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setText("text3556653") + .setFormattedText("formattedText-1717326839") + .addAllCards(new ArrayList()) + .addAllCardsV2(new ArrayList()) + .addAllAnnotations(new ArrayList()) + .setThread(Thread.newBuilder().build()) + .setSpace(Space.newBuilder().build()) + .setFallbackText("fallbackText-1783292113") + .setActionResponse(ActionResponse.newBuilder().build()) + .setArgumentText("argumentText552563082") + .setSlashCommand(SlashCommand.newBuilder().build()) + .addAllAttachment(new ArrayList()) + .setMatchedUrl(MatchedUrl.newBuilder().build()) + .setThreadReply(true) + .setClientAssignedMessageId("clientAssignedMessageId-750462775") + .addAllEmojiReactionSummaries(new ArrayList()) + .setPrivateMessageViewer(User.newBuilder().build()) + .setDeletionMetadata(DeletionMetadata.newBuilder().build()) + .setQuotedMessageMetadata(QuotedMessageMetadata.newBuilder().build()) + .addAllAttachedGifs(new ArrayList()) + .build(); + mockChatService.addResponse(expectedResponse); + + Message message = Message.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Message actualResponse = client.updateMessage(message, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateMessageRequest actualRequest = ((UpdateMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateMessageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + Message message = Message.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateMessage(message, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMessageTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockChatService.addResponse(expectedResponse); + + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + + client.deleteMessage(name); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteMessageRequest actualRequest = ((DeleteMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteMessageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + MessageName name = MessageName.of("[SPACE]", "[MESSAGE]"); + client.deleteMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMessageTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteMessage(name); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteMessageRequest actualRequest = ((DeleteMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteMessageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.deleteMessage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttachmentTest() throws Exception { + Attachment expectedResponse = + Attachment.newBuilder() + .setName(AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]").toString()) + .setContentName("contentName-389333340") + .setContentType("contentType-389131437") + .setThumbnailUri("thumbnailUri-356760352") + .setDownloadUri("downloadUri-1211148348") + .build(); + mockChatService.addResponse(expectedResponse); + + AttachmentName name = AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]"); + + Attachment actualResponse = client.getAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttachmentRequest actualRequest = ((GetAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttachmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + AttachmentName name = AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]"); + client.getAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttachmentTest2() throws Exception { + Attachment expectedResponse = + Attachment.newBuilder() + .setName(AttachmentName.of("[SPACE]", "[MESSAGE]", "[ATTACHMENT]").toString()) + .setContentName("contentName-389333340") + .setContentType("contentType-389131437") + .setThumbnailUri("thumbnailUri-356760352") + .setDownloadUri("downloadUri-1211148348") + .build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + Attachment actualResponse = client.getAttachment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttachmentRequest actualRequest = ((GetAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttachmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.getAttachment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void uploadAttachmentTest() throws Exception { + UploadAttachmentResponse expectedResponse = + UploadAttachmentResponse.newBuilder() + .setAttachmentDataRef(AttachmentDataRef.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + UploadAttachmentRequest request = + UploadAttachmentRequest.newBuilder() + .setParent(SpaceName.of("[SPACE]").toString()) + .setFilename("filename-734768633") + .build(); + + UploadAttachmentResponse actualResponse = client.uploadAttachment(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UploadAttachmentRequest actualRequest = ((UploadAttachmentRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getFilename(), actualRequest.getFilename()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void uploadAttachmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + UploadAttachmentRequest request = + UploadAttachmentRequest.newBuilder() + .setParent(SpaceName.of("[SPACE]").toString()) + .setFilename("filename-734768633") + .build(); + client.uploadAttachment(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpacesTest() throws Exception { + Space responsesElement = Space.newBuilder().build(); + ListSpacesResponse expectedResponse = + ListSpacesResponse.newBuilder() + .setNextPageToken("") + .addAllSpaces(Arrays.asList(responsesElement)) + .build(); + mockChatService.addResponse(expectedResponse); + + ListSpacesPagedResponse pagedListResponse = client.listSpaces(); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpacesList().get(0), resources.get(0)); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSpacesRequest actualRequest = ((ListSpacesRequest) actualRequests.get(0)); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSpacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + ListSpacesRequest request = + ListSpacesRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + client.listSpaces(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockChatService.addResponse(expectedResponse); + + SpaceName name = SpaceName.of("[SPACE]"); + + Space actualResponse = client.getSpace(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpaceRequest actualRequest = ((GetSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + SpaceName name = SpaceName.of("[SPACE]"); + client.getSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpaceTest2() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + Space actualResponse = client.getSpace(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpaceRequest actualRequest = ((GetSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpaceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.getSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockChatService.addResponse(expectedResponse); + + Space space = Space.newBuilder().build(); + + Space actualResponse = client.createSpace(space); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSpaceRequest actualRequest = ((CreateSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(space, actualRequest.getSpace()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSpaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + Space space = Space.newBuilder().build(); + client.createSpace(space); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setUpSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockChatService.addResponse(expectedResponse); + + SetUpSpaceRequest request = + SetUpSpaceRequest.newBuilder() + .setSpace(Space.newBuilder().build()) + .setRequestId("requestId693933066") + .addAllMemberships(new ArrayList()) + .build(); + + Space actualResponse = client.setUpSpace(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetUpSpaceRequest actualRequest = ((SetUpSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSpace(), actualRequest.getSpace()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getMembershipsList(), actualRequest.getMembershipsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setUpSpaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + SetUpSpaceRequest request = + SetUpSpaceRequest.newBuilder() + .setSpace(Space.newBuilder().build()) + .setRequestId("requestId693933066") + .addAllMemberships(new ArrayList()) + .build(); + client.setUpSpace(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSpaceTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockChatService.addResponse(expectedResponse); + + Space space = Space.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Space actualResponse = client.updateSpace(space, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSpaceRequest actualRequest = ((UpdateSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(space, actualRequest.getSpace()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSpaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + Space space = Space.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSpace(space, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpaceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockChatService.addResponse(expectedResponse); + + SpaceName name = SpaceName.of("[SPACE]"); + + client.deleteSpace(name); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpaceRequest actualRequest = ((DeleteSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + SpaceName name = SpaceName.of("[SPACE]"); + client.deleteSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSpaceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteSpace(name); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpaceRequest actualRequest = ((DeleteSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpaceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSpace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void completeImportSpaceTest() throws Exception { + CompleteImportSpaceResponse expectedResponse = + CompleteImportSpaceResponse.newBuilder().setSpace(Space.newBuilder().build()).build(); + mockChatService.addResponse(expectedResponse); + + CompleteImportSpaceRequest request = + CompleteImportSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build(); + + CompleteImportSpaceResponse actualResponse = client.completeImportSpace(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CompleteImportSpaceRequest actualRequest = ((CompleteImportSpaceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void completeImportSpaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + CompleteImportSpaceRequest request = + CompleteImportSpaceRequest.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .build(); + client.completeImportSpace(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void findDirectMessageTest() throws Exception { + Space expectedResponse = + Space.newBuilder() + .setName(SpaceName.of("[SPACE]").toString()) + .setSingleUserBotDm(true) + .setThreaded(true) + .setDisplayName("displayName1714148973") + .setExternalUserAllowed(true) + .setSpaceDetails(Space.SpaceDetails.newBuilder().build()) + .setSpaceHistoryState(HistoryState.forNumber(0)) + .setImportMode(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setAdminInstalled(true) + .build(); + mockChatService.addResponse(expectedResponse); + + FindDirectMessageRequest request = + FindDirectMessageRequest.newBuilder().setName("name3373707").build(); + + Space actualResponse = client.findDirectMessage(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FindDirectMessageRequest actualRequest = ((FindDirectMessageRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void findDirectMessageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + FindDirectMessageRequest request = + FindDirectMessageRequest.newBuilder().setName("name3373707").build(); + client.findDirectMessage(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + SpaceName parent = SpaceName.of("[SPACE]"); + Membership membership = Membership.newBuilder().build(); + + Membership actualResponse = client.createMembership(parent, membership); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateMembershipRequest actualRequest = ((CreateMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(membership, actualRequest.getMembership()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createMembershipExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + SpaceName parent = SpaceName.of("[SPACE]"); + Membership membership = Membership.newBuilder().build(); + client.createMembership(parent, membership); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Membership membership = Membership.newBuilder().build(); + + Membership actualResponse = client.createMembership(parent, membership); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateMembershipRequest actualRequest = ((CreateMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(membership, actualRequest.getMembership()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createMembershipExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String parent = "parent-995424086"; + Membership membership = Membership.newBuilder().build(); + client.createMembership(parent, membership); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + + Membership actualResponse = client.deleteMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteMembershipRequest actualRequest = ((DeleteMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteMembershipExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + MembershipName name = MembershipName.of("[SPACE]", "[MEMBER]"); + client.deleteMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[SPACE]", "[MEMBER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + Membership actualResponse = client.deleteMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteMembershipRequest actualRequest = ((DeleteMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteMembershipExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.deleteMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReactionTest() throws Exception { + Reaction expectedResponse = + Reaction.newBuilder() + .setName(ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]").toString()) + .setUser(User.newBuilder().build()) + .setEmoji(Emoji.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + Reaction reaction = Reaction.newBuilder().build(); + + Reaction actualResponse = client.createReaction(parent, reaction); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReactionRequest actualRequest = ((CreateReactionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(reaction, actualRequest.getReaction()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createReactionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + Reaction reaction = Reaction.newBuilder().build(); + client.createReaction(parent, reaction); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReactionTest2() throws Exception { + Reaction expectedResponse = + Reaction.newBuilder() + .setName(ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]").toString()) + .setUser(User.newBuilder().build()) + .setEmoji(Emoji.newBuilder().build()) + .build(); + mockChatService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Reaction reaction = Reaction.newBuilder().build(); + + Reaction actualResponse = client.createReaction(parent, reaction); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReactionRequest actualRequest = ((CreateReactionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(reaction, actualRequest.getReaction()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createReactionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String parent = "parent-995424086"; + Reaction reaction = Reaction.newBuilder().build(); + client.createReaction(parent, reaction); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReactionsTest() throws Exception { + Reaction responsesElement = Reaction.newBuilder().build(); + ListReactionsResponse expectedResponse = + ListReactionsResponse.newBuilder() + .setNextPageToken("") + .addAllReactions(Arrays.asList(responsesElement)) + .build(); + mockChatService.addResponse(expectedResponse); + + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + + ListReactionsPagedResponse pagedListResponse = client.listReactions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReactionsList().get(0), resources.get(0)); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReactionsRequest actualRequest = ((ListReactionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReactionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + MessageName parent = MessageName.of("[SPACE]", "[MESSAGE]"); + client.listReactions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReactionsTest2() throws Exception { + Reaction responsesElement = Reaction.newBuilder().build(); + ListReactionsResponse expectedResponse = + ListReactionsResponse.newBuilder() + .setNextPageToken("") + .addAllReactions(Arrays.asList(responsesElement)) + .build(); + mockChatService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListReactionsPagedResponse pagedListResponse = client.listReactions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReactionsList().get(0), resources.get(0)); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReactionsRequest actualRequest = ((ListReactionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReactionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listReactions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReactionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockChatService.addResponse(expectedResponse); + + ReactionName name = ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]"); + + client.deleteReaction(name); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReactionRequest actualRequest = ((DeleteReactionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteReactionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + ReactionName name = ReactionName.of("[SPACE]", "[MESSAGE]", "[REACTION]"); + client.deleteReaction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReactionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockChatService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteReaction(name); + + List actualRequests = mockChatService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReactionRequest actualRequest = ((DeleteReactionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteReactionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockChatService.addException(exception); + + try { + String name = "name3373707"; + client.deleteReaction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/MockChatService.java b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/MockChatService.java new file mode 100644 index 000000000000..336f537b32aa --- /dev/null +++ b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/MockChatService.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.chat.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 MockChatService implements MockGrpcService { + private final MockChatServiceImpl serviceImpl; + + public MockChatService() { + serviceImpl = new MockChatServiceImpl(); + } + + @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-chat/google-cloud-chat/src/test/java/com/google/chat/v1/MockChatServiceImpl.java b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/MockChatServiceImpl.java new file mode 100644 index 000000000000..2f8674ad0884 --- /dev/null +++ b/java-chat/google-cloud-chat/src/test/java/com/google/chat/v1/MockChatServiceImpl.java @@ -0,0 +1,517 @@ +/* + * 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.chat.v1; + +import com.google.api.core.BetaApi; +import com.google.chat.v1.ChatServiceGrpc.ChatServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockChatServiceImpl extends ChatServiceImplBase { + private List requests; + private Queue responses; + + public MockChatServiceImpl() { + 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 createMessage( + CreateMessageRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Message) { + requests.add(request); + responseObserver.onNext(((Message) 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 CreateMessage, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Message.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listMessages( + ListMessagesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListMessagesResponse) { + requests.add(request); + responseObserver.onNext(((ListMessagesResponse) 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 ListMessages, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListMessagesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listMemberships( + ListMembershipsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListMembershipsResponse) { + requests.add(request); + responseObserver.onNext(((ListMembershipsResponse) 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 ListMemberships, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListMembershipsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getMembership( + GetMembershipRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Membership) { + requests.add(request); + responseObserver.onNext(((Membership) 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 GetMembership, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Membership.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getMessage(GetMessageRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Message) { + requests.add(request); + responseObserver.onNext(((Message) 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 GetMessage, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Message.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateMessage( + UpdateMessageRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Message) { + requests.add(request); + responseObserver.onNext(((Message) 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 UpdateMessage, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Message.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteMessage(DeleteMessageRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteMessage, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAttachment( + GetAttachmentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Attachment) { + requests.add(request); + responseObserver.onNext(((Attachment) 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 GetAttachment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Attachment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void uploadAttachment( + UploadAttachmentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof UploadAttachmentResponse) { + requests.add(request); + responseObserver.onNext(((UploadAttachmentResponse) 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 UploadAttachment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + UploadAttachmentResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSpaces( + ListSpacesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSpacesResponse) { + requests.add(request); + responseObserver.onNext(((ListSpacesResponse) 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 ListSpaces, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSpacesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSpace(GetSpaceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Space) { + requests.add(request); + responseObserver.onNext(((Space) 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 GetSpace, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Space.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSpace(CreateSpaceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Space) { + requests.add(request); + responseObserver.onNext(((Space) 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 CreateSpace, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Space.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setUpSpace(SetUpSpaceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Space) { + requests.add(request); + responseObserver.onNext(((Space) 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 SetUpSpace, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Space.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSpace(UpdateSpaceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Space) { + requests.add(request); + responseObserver.onNext(((Space) 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 UpdateSpace, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Space.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSpace(DeleteSpaceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSpace, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void completeImportSpace( + CompleteImportSpaceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompleteImportSpaceResponse) { + requests.add(request); + responseObserver.onNext(((CompleteImportSpaceResponse) 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 CompleteImportSpace, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompleteImportSpaceResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void findDirectMessage( + FindDirectMessageRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Space) { + requests.add(request); + responseObserver.onNext(((Space) 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 FindDirectMessage, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Space.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createMembership( + CreateMembershipRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Membership) { + requests.add(request); + responseObserver.onNext(((Membership) 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 CreateMembership, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Membership.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteMembership( + DeleteMembershipRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Membership) { + requests.add(request); + responseObserver.onNext(((Membership) 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 DeleteMembership, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Membership.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createReaction( + CreateReactionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Reaction) { + requests.add(request); + responseObserver.onNext(((Reaction) 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 CreateReaction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Reaction.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listReactions( + ListReactionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListReactionsResponse) { + requests.add(request); + responseObserver.onNext(((ListReactionsResponse) 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 ListReactions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListReactionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteReaction( + DeleteReactionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteReaction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-chat/grpc-google-cloud-chat-v1/pom.xml b/java-chat/grpc-google-cloud-chat-v1/pom.xml new file mode 100644 index 000000000000..fd9f919f59a0 --- /dev/null +++ b/java-chat/grpc-google-cloud-chat-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-chat-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-chat-v1 + GRPC library for google-cloud-chat + + com.google.cloud + google-cloud-chat-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-chat-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-chat/grpc-google-cloud-chat-v1/src/main/java/com/google/chat/v1/ChatServiceGrpc.java b/java-chat/grpc-google-cloud-chat-v1/src/main/java/com/google/chat/v1/ChatServiceGrpc.java new file mode 100644 index 000000000000..e07b3217c5d8 --- /dev/null +++ b/java-chat/grpc-google-cloud-chat-v1/src/main/java/com/google/chat/v1/ChatServiceGrpc.java @@ -0,0 +1,3525 @@ +/* + * 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.chat.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Enables developers to build Chat apps and
+ * integrations on Google Chat Platform.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/chat/v1/chat_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ChatServiceGrpc { + + private ChatServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.chat.v1.ChatService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.CreateMessageRequest, com.google.chat.v1.Message> + getCreateMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateMessage", + requestType = com.google.chat.v1.CreateMessageRequest.class, + responseType = com.google.chat.v1.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.CreateMessageRequest, com.google.chat.v1.Message> + getCreateMessageMethod() { + io.grpc.MethodDescriptor + getCreateMessageMethod; + if ((getCreateMessageMethod = ChatServiceGrpc.getCreateMessageMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getCreateMessageMethod = ChatServiceGrpc.getCreateMessageMethod) == null) { + ChatServiceGrpc.getCreateMessageMethod = + getCreateMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.CreateMessageRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Message.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("CreateMessage")) + .build(); + } + } + } + return getCreateMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.ListMessagesRequest, com.google.chat.v1.ListMessagesResponse> + getListMessagesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListMessages", + requestType = com.google.chat.v1.ListMessagesRequest.class, + responseType = com.google.chat.v1.ListMessagesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.ListMessagesRequest, com.google.chat.v1.ListMessagesResponse> + getListMessagesMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.ListMessagesRequest, com.google.chat.v1.ListMessagesResponse> + getListMessagesMethod; + if ((getListMessagesMethod = ChatServiceGrpc.getListMessagesMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getListMessagesMethod = ChatServiceGrpc.getListMessagesMethod) == null) { + ChatServiceGrpc.getListMessagesMethod = + getListMessagesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListMessages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListMessagesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListMessagesResponse.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("ListMessages")) + .build(); + } + } + } + return getListMessagesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.ListMembershipsRequest, com.google.chat.v1.ListMembershipsResponse> + getListMembershipsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListMemberships", + requestType = com.google.chat.v1.ListMembershipsRequest.class, + responseType = com.google.chat.v1.ListMembershipsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.ListMembershipsRequest, com.google.chat.v1.ListMembershipsResponse> + getListMembershipsMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.ListMembershipsRequest, com.google.chat.v1.ListMembershipsResponse> + getListMembershipsMethod; + if ((getListMembershipsMethod = ChatServiceGrpc.getListMembershipsMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getListMembershipsMethod = ChatServiceGrpc.getListMembershipsMethod) == null) { + ChatServiceGrpc.getListMembershipsMethod = + getListMembershipsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListMemberships")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListMembershipsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListMembershipsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("ListMemberships")) + .build(); + } + } + } + return getListMembershipsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.GetMembershipRequest, com.google.chat.v1.Membership> + getGetMembershipMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetMembership", + requestType = com.google.chat.v1.GetMembershipRequest.class, + responseType = com.google.chat.v1.Membership.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.GetMembershipRequest, com.google.chat.v1.Membership> + getGetMembershipMethod() { + io.grpc.MethodDescriptor + getGetMembershipMethod; + if ((getGetMembershipMethod = ChatServiceGrpc.getGetMembershipMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getGetMembershipMethod = ChatServiceGrpc.getGetMembershipMethod) == null) { + ChatServiceGrpc.getGetMembershipMethod = + getGetMembershipMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetMembership")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.GetMembershipRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Membership.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("GetMembership")) + .build(); + } + } + } + return getGetMembershipMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.GetMessageRequest, com.google.chat.v1.Message> + getGetMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetMessage", + requestType = com.google.chat.v1.GetMessageRequest.class, + responseType = com.google.chat.v1.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.GetMessageRequest, com.google.chat.v1.Message> + getGetMessageMethod() { + io.grpc.MethodDescriptor + getGetMessageMethod; + if ((getGetMessageMethod = ChatServiceGrpc.getGetMessageMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getGetMessageMethod = ChatServiceGrpc.getGetMessageMethod) == null) { + ChatServiceGrpc.getGetMessageMethod = + getGetMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.GetMessageRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Message.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("GetMessage")) + .build(); + } + } + } + return getGetMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.UpdateMessageRequest, com.google.chat.v1.Message> + getUpdateMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateMessage", + requestType = com.google.chat.v1.UpdateMessageRequest.class, + responseType = com.google.chat.v1.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.UpdateMessageRequest, com.google.chat.v1.Message> + getUpdateMessageMethod() { + io.grpc.MethodDescriptor + getUpdateMessageMethod; + if ((getUpdateMessageMethod = ChatServiceGrpc.getUpdateMessageMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getUpdateMessageMethod = ChatServiceGrpc.getUpdateMessageMethod) == null) { + ChatServiceGrpc.getUpdateMessageMethod = + getUpdateMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.UpdateMessageRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Message.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("UpdateMessage")) + .build(); + } + } + } + return getUpdateMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteMessageRequest, com.google.protobuf.Empty> + getDeleteMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteMessage", + requestType = com.google.chat.v1.DeleteMessageRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteMessageRequest, com.google.protobuf.Empty> + getDeleteMessageMethod() { + io.grpc.MethodDescriptor + getDeleteMessageMethod; + if ((getDeleteMessageMethod = ChatServiceGrpc.getDeleteMessageMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getDeleteMessageMethod = ChatServiceGrpc.getDeleteMessageMethod) == null) { + ChatServiceGrpc.getDeleteMessageMethod = + getDeleteMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.DeleteMessageRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("DeleteMessage")) + .build(); + } + } + } + return getDeleteMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.GetAttachmentRequest, com.google.chat.v1.Attachment> + getGetAttachmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAttachment", + requestType = com.google.chat.v1.GetAttachmentRequest.class, + responseType = com.google.chat.v1.Attachment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.GetAttachmentRequest, com.google.chat.v1.Attachment> + getGetAttachmentMethod() { + io.grpc.MethodDescriptor + getGetAttachmentMethod; + if ((getGetAttachmentMethod = ChatServiceGrpc.getGetAttachmentMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getGetAttachmentMethod = ChatServiceGrpc.getGetAttachmentMethod) == null) { + ChatServiceGrpc.getGetAttachmentMethod = + getGetAttachmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAttachment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.GetAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Attachment.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("GetAttachment")) + .build(); + } + } + } + return getGetAttachmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.UploadAttachmentRequest, com.google.chat.v1.UploadAttachmentResponse> + getUploadAttachmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UploadAttachment", + requestType = com.google.chat.v1.UploadAttachmentRequest.class, + responseType = com.google.chat.v1.UploadAttachmentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.UploadAttachmentRequest, com.google.chat.v1.UploadAttachmentResponse> + getUploadAttachmentMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.UploadAttachmentRequest, com.google.chat.v1.UploadAttachmentResponse> + getUploadAttachmentMethod; + if ((getUploadAttachmentMethod = ChatServiceGrpc.getUploadAttachmentMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getUploadAttachmentMethod = ChatServiceGrpc.getUploadAttachmentMethod) == null) { + ChatServiceGrpc.getUploadAttachmentMethod = + getUploadAttachmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UploadAttachment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.UploadAttachmentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.UploadAttachmentResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("UploadAttachment")) + .build(); + } + } + } + return getUploadAttachmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.ListSpacesRequest, com.google.chat.v1.ListSpacesResponse> + getListSpacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSpaces", + requestType = com.google.chat.v1.ListSpacesRequest.class, + responseType = com.google.chat.v1.ListSpacesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.ListSpacesRequest, com.google.chat.v1.ListSpacesResponse> + getListSpacesMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.ListSpacesRequest, com.google.chat.v1.ListSpacesResponse> + getListSpacesMethod; + if ((getListSpacesMethod = ChatServiceGrpc.getListSpacesMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getListSpacesMethod = ChatServiceGrpc.getListSpacesMethod) == null) { + ChatServiceGrpc.getListSpacesMethod = + getListSpacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSpaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListSpacesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListSpacesResponse.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("ListSpaces")) + .build(); + } + } + } + return getListSpacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.GetSpaceRequest, com.google.chat.v1.Space> + getGetSpaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSpace", + requestType = com.google.chat.v1.GetSpaceRequest.class, + responseType = com.google.chat.v1.Space.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.GetSpaceRequest, com.google.chat.v1.Space> + getGetSpaceMethod() { + io.grpc.MethodDescriptor + getGetSpaceMethod; + if ((getGetSpaceMethod = ChatServiceGrpc.getGetSpaceMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getGetSpaceMethod = ChatServiceGrpc.getGetSpaceMethod) == null) { + ChatServiceGrpc.getGetSpaceMethod = + getGetSpaceMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSpace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.GetSpaceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Space.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("GetSpace")) + .build(); + } + } + } + return getGetSpaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.CreateSpaceRequest, com.google.chat.v1.Space> + getCreateSpaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSpace", + requestType = com.google.chat.v1.CreateSpaceRequest.class, + responseType = com.google.chat.v1.Space.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.CreateSpaceRequest, com.google.chat.v1.Space> + getCreateSpaceMethod() { + io.grpc.MethodDescriptor + getCreateSpaceMethod; + if ((getCreateSpaceMethod = ChatServiceGrpc.getCreateSpaceMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getCreateSpaceMethod = ChatServiceGrpc.getCreateSpaceMethod) == null) { + ChatServiceGrpc.getCreateSpaceMethod = + getCreateSpaceMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSpace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.CreateSpaceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Space.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("CreateSpace")) + .build(); + } + } + } + return getCreateSpaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.SetUpSpaceRequest, com.google.chat.v1.Space> + getSetUpSpaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetUpSpace", + requestType = com.google.chat.v1.SetUpSpaceRequest.class, + responseType = com.google.chat.v1.Space.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.SetUpSpaceRequest, com.google.chat.v1.Space> + getSetUpSpaceMethod() { + io.grpc.MethodDescriptor + getSetUpSpaceMethod; + if ((getSetUpSpaceMethod = ChatServiceGrpc.getSetUpSpaceMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getSetUpSpaceMethod = ChatServiceGrpc.getSetUpSpaceMethod) == null) { + ChatServiceGrpc.getSetUpSpaceMethod = + getSetUpSpaceMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetUpSpace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.SetUpSpaceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Space.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("SetUpSpace")) + .build(); + } + } + } + return getSetUpSpaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.UpdateSpaceRequest, com.google.chat.v1.Space> + getUpdateSpaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSpace", + requestType = com.google.chat.v1.UpdateSpaceRequest.class, + responseType = com.google.chat.v1.Space.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.UpdateSpaceRequest, com.google.chat.v1.Space> + getUpdateSpaceMethod() { + io.grpc.MethodDescriptor + getUpdateSpaceMethod; + if ((getUpdateSpaceMethod = ChatServiceGrpc.getUpdateSpaceMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getUpdateSpaceMethod = ChatServiceGrpc.getUpdateSpaceMethod) == null) { + ChatServiceGrpc.getUpdateSpaceMethod = + getUpdateSpaceMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSpace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.UpdateSpaceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Space.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("UpdateSpace")) + .build(); + } + } + } + return getUpdateSpaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteSpaceRequest, com.google.protobuf.Empty> + getDeleteSpaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSpace", + requestType = com.google.chat.v1.DeleteSpaceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteSpaceRequest, com.google.protobuf.Empty> + getDeleteSpaceMethod() { + io.grpc.MethodDescriptor + getDeleteSpaceMethod; + if ((getDeleteSpaceMethod = ChatServiceGrpc.getDeleteSpaceMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getDeleteSpaceMethod = ChatServiceGrpc.getDeleteSpaceMethod) == null) { + ChatServiceGrpc.getDeleteSpaceMethod = + getDeleteSpaceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSpace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.DeleteSpaceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("DeleteSpace")) + .build(); + } + } + } + return getDeleteSpaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.CompleteImportSpaceRequest, + com.google.chat.v1.CompleteImportSpaceResponse> + getCompleteImportSpaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CompleteImportSpace", + requestType = com.google.chat.v1.CompleteImportSpaceRequest.class, + responseType = com.google.chat.v1.CompleteImportSpaceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.CompleteImportSpaceRequest, + com.google.chat.v1.CompleteImportSpaceResponse> + getCompleteImportSpaceMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.CompleteImportSpaceRequest, + com.google.chat.v1.CompleteImportSpaceResponse> + getCompleteImportSpaceMethod; + if ((getCompleteImportSpaceMethod = ChatServiceGrpc.getCompleteImportSpaceMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getCompleteImportSpaceMethod = ChatServiceGrpc.getCompleteImportSpaceMethod) == null) { + ChatServiceGrpc.getCompleteImportSpaceMethod = + getCompleteImportSpaceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CompleteImportSpace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.CompleteImportSpaceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.CompleteImportSpaceResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("CompleteImportSpace")) + .build(); + } + } + } + return getCompleteImportSpaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.FindDirectMessageRequest, com.google.chat.v1.Space> + getFindDirectMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FindDirectMessage", + requestType = com.google.chat.v1.FindDirectMessageRequest.class, + responseType = com.google.chat.v1.Space.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.FindDirectMessageRequest, com.google.chat.v1.Space> + getFindDirectMessageMethod() { + io.grpc.MethodDescriptor + getFindDirectMessageMethod; + if ((getFindDirectMessageMethod = ChatServiceGrpc.getFindDirectMessageMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getFindDirectMessageMethod = ChatServiceGrpc.getFindDirectMessageMethod) == null) { + ChatServiceGrpc.getFindDirectMessageMethod = + getFindDirectMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FindDirectMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.FindDirectMessageRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Space.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("FindDirectMessage")) + .build(); + } + } + } + return getFindDirectMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.CreateMembershipRequest, com.google.chat.v1.Membership> + getCreateMembershipMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateMembership", + requestType = com.google.chat.v1.CreateMembershipRequest.class, + responseType = com.google.chat.v1.Membership.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.CreateMembershipRequest, com.google.chat.v1.Membership> + getCreateMembershipMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.CreateMembershipRequest, com.google.chat.v1.Membership> + getCreateMembershipMethod; + if ((getCreateMembershipMethod = ChatServiceGrpc.getCreateMembershipMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getCreateMembershipMethod = ChatServiceGrpc.getCreateMembershipMethod) == null) { + ChatServiceGrpc.getCreateMembershipMethod = + getCreateMembershipMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateMembership")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.CreateMembershipRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Membership.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("CreateMembership")) + .build(); + } + } + } + return getCreateMembershipMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteMembershipRequest, com.google.chat.v1.Membership> + getDeleteMembershipMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteMembership", + requestType = com.google.chat.v1.DeleteMembershipRequest.class, + responseType = com.google.chat.v1.Membership.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteMembershipRequest, com.google.chat.v1.Membership> + getDeleteMembershipMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteMembershipRequest, com.google.chat.v1.Membership> + getDeleteMembershipMethod; + if ((getDeleteMembershipMethod = ChatServiceGrpc.getDeleteMembershipMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getDeleteMembershipMethod = ChatServiceGrpc.getDeleteMembershipMethod) == null) { + ChatServiceGrpc.getDeleteMembershipMethod = + getDeleteMembershipMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteMembership")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.DeleteMembershipRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Membership.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("DeleteMembership")) + .build(); + } + } + } + return getDeleteMembershipMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.CreateReactionRequest, com.google.chat.v1.Reaction> + getCreateReactionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateReaction", + requestType = com.google.chat.v1.CreateReactionRequest.class, + responseType = com.google.chat.v1.Reaction.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.CreateReactionRequest, com.google.chat.v1.Reaction> + getCreateReactionMethod() { + io.grpc.MethodDescriptor + getCreateReactionMethod; + if ((getCreateReactionMethod = ChatServiceGrpc.getCreateReactionMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getCreateReactionMethod = ChatServiceGrpc.getCreateReactionMethod) == null) { + ChatServiceGrpc.getCreateReactionMethod = + getCreateReactionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateReaction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.CreateReactionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.Reaction.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("CreateReaction")) + .build(); + } + } + } + return getCreateReactionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.ListReactionsRequest, com.google.chat.v1.ListReactionsResponse> + getListReactionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListReactions", + requestType = com.google.chat.v1.ListReactionsRequest.class, + responseType = com.google.chat.v1.ListReactionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.ListReactionsRequest, com.google.chat.v1.ListReactionsResponse> + getListReactionsMethod() { + io.grpc.MethodDescriptor< + com.google.chat.v1.ListReactionsRequest, com.google.chat.v1.ListReactionsResponse> + getListReactionsMethod; + if ((getListReactionsMethod = ChatServiceGrpc.getListReactionsMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getListReactionsMethod = ChatServiceGrpc.getListReactionsMethod) == null) { + ChatServiceGrpc.getListReactionsMethod = + getListReactionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListReactions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListReactionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.ListReactionsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ChatServiceMethodDescriptorSupplier("ListReactions")) + .build(); + } + } + } + return getListReactionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteReactionRequest, com.google.protobuf.Empty> + getDeleteReactionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteReaction", + requestType = com.google.chat.v1.DeleteReactionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.chat.v1.DeleteReactionRequest, com.google.protobuf.Empty> + getDeleteReactionMethod() { + io.grpc.MethodDescriptor + getDeleteReactionMethod; + if ((getDeleteReactionMethod = ChatServiceGrpc.getDeleteReactionMethod) == null) { + synchronized (ChatServiceGrpc.class) { + if ((getDeleteReactionMethod = ChatServiceGrpc.getDeleteReactionMethod) == null) { + ChatServiceGrpc.getDeleteReactionMethod = + getDeleteReactionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteReaction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.chat.v1.DeleteReactionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ChatServiceMethodDescriptorSupplier("DeleteReaction")) + .build(); + } + } + } + return getDeleteReactionMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ChatServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ChatServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ChatServiceStub(channel, callOptions); + } + }; + return ChatServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ChatServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ChatServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ChatServiceBlockingStub(channel, callOptions); + } + }; + return ChatServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ChatServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ChatServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ChatServiceFutureStub(channel, callOptions); + } + }; + return ChatServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Enables developers to build Chat apps and
+   * integrations on Google Chat Platform.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a message in a Google Chat space. For an example, see [Create a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/create).
+     * Calling this method requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth) and
+     * supports the following authentication types:
+     * - For text messages, user authentication or app authentication are
+     * supported.
+     * - For card messages, only app authentication is supported. (Only Chat apps
+     * can create card messages.)
+     * 
+ */ + default void createMessage( + com.google.chat.v1.CreateMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateMessageMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists messages in a space that the caller is a member of, including
+     * messages from blocked members and spaces. For an example, see
+     * [List messages](/chat/api/guides/v1/messages/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void listMessages( + com.google.chat.v1.ListMessagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListMessagesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists memberships in a space. For an example, see [List
+     * memberships](https://developers.google.com/chat/api/guides/v1/members/list).
+     * Listing memberships with
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * lists memberships in spaces that the Chat app has
+     * access to, but excludes Chat app memberships,
+     * including its own. Listing memberships with
+     * [User
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * lists memberships in spaces that the authenticated user has access to.
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void listMemberships( + com.google.chat.v1.ListMembershipsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListMembershipsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns details about a membership. For an example, see
+     * [Get a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void getMembership( + com.google.chat.v1.GetMembershipRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetMembershipMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns details about a message.
+     * For an example, see [Read a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Note: Might return a message from a blocked member or space.
+     * 
+ */ + default void getMessage( + com.google.chat.v1.GetMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMessageMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a message. There's a difference between the `patch` and `update`
+     * methods. The `patch`
+     * method uses a `patch` request while the `update` method uses a `put`
+     * request. We recommend using the `patch` method. For an example, see
+     * [Update a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/update).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only update messages
+     * created by the calling Chat app.
+     * 
+ */ + default void updateMessage( + com.google.chat.v1.UpdateMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateMessageMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a message.
+     * For an example, see [Delete a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/delete).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only delete messages
+     * created by the calling Chat app.
+     * 
+ */ + default void deleteMessage( + com.google.chat.v1.DeleteMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteMessageMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the metadata of a message attachment. The attachment data is fetched
+     * using the [media
+     * API](https://developers.google.com/chat/api/reference/rest/v1/media/download).
+     * For an example, see
+     * [Get a message
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get).
+     * Requires [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + default void getAttachment( + com.google.chat.v1.GetAttachmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAttachmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Uploads an attachment. For an example, see
+     * [Upload media as a file
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload).
+     * Requires user
+     * [authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * You can upload attachments up to 200 MB. Certain file types aren't
+     * supported. For details, see [File types blocked by Google
+     * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
+     * 
+ */ + default void uploadAttachment( + com.google.chat.v1.UploadAttachmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUploadAttachmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists spaces the caller is a member of. Group chats and DMs aren't listed
+     * until the first message is sent. For an example, see
+     * [List
+     * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Lists spaces visible to the caller or authenticated user. Group chats
+     * and DMs aren't listed until the first message is sent.
+     * 
+ */ + default void listSpaces( + com.google.chat.v1.ListSpacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSpacesMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns details about a space. For an example, see
+     * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void getSpace( + com.google.chat.v1.GetSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSpaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a named space. Spaces grouped by topics aren't supported. For an
+     * example, see [Create a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/create).
+     *  If you receive the error message `ALREADY_EXISTS` when creating
+     *  a space, try a different `displayName`. An existing space within
+     *  the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void createSpace( + com.google.chat.v1.CreateSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSpaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a space and adds specified users to it. The calling user is
+     * automatically added to the space, and shouldn't be specified as a
+     * membership in the request. For an example, see
+     * [Set up a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up).
+     * To specify the human members to add, add memberships with the appropriate
+     * `member.name` in the `SetUpSpaceRequest`. To add a human user, use
+     * `users/{user}`, where `{user}` can be the email address for the user. For
+     * users in the same Workspace organization `{user}` can also be the `id` for
+     * the person from the People API, or the `id` for the user in the Directory
+     * API. For example, if the People API Person profile ID for
+     * `user@example.com` is `123456789`, you can add the user to the space by
+     * setting the `membership.member.name` to `users/user@example.com` or
+     * `users/123456789`.
+     * For a space or group chat, if the caller blocks or is blocked by some
+     * members, then those members aren't added to the created space.
+     * To create a direct message (DM) between the calling user and another human
+     * user, specify exactly one membership to represent the human user. If
+     * one user blocks the other, the request fails and the DM isn't created.
+     * To create a DM between the calling user and the calling app, set
+     * `Space.singleUserBotDm` to `true` and don't specify any memberships. You
+     * can only use this method to set up a DM with the calling app. To add the
+     * calling app as a member of a space or an existing DM between two human
+     * users, see
+     * [create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * If a DM already exists between two users, even when one user blocks the
+     * other at the time a request is made, then the existing DM is returned.
+     * Spaces with threaded replies aren't supported. If you receive the error
+     * message `ALREADY_EXISTS` when setting up a space, try a different
+     * `displayName`. An existing space within the Google Workspace organization
+     * might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void setUpSpace( + com.google.chat.v1.SetUpSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetUpSpaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a space. For an example, see
+     * [Update a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/update).
+     * If you're updating the `displayName` field and receive the error message
+     * `ALREADY_EXISTS`, try a different display name.. An existing space within
+     * the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void updateSpace( + com.google.chat.v1.UpdateSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSpaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a named space. Always performs a cascading delete, which means
+     * that the space's child resources—like messages posted in the space and
+     * memberships in the space—are also deleted. For an example, see
+     * [Delete a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * from a user who has permission to delete the space.
+     * 
+ */ + default void deleteSpace( + com.google.chat.v1.DeleteSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSpaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Completes the
+     * [import process](https://developers.google.com/chat/api/guides/import-data)
+     * for the specified space and makes it visible to users.
+     * Requires app authentication and domain-wide delegation. For more
+     * information, see [Authorize Google Chat apps to import
+     * data](https://developers.google.com/chat/api/guides/authorize-import).
+     * 
+ */ + default void completeImportSpace( + com.google.chat.v1.CompleteImportSpaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCompleteImportSpaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the existing direct message with the specified user. If no direct
+     * message space is found, returns a `404 NOT_FOUND` error. For an example,
+     * see
+     * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
+     * With [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users),
+     * returns the direct message space between the specified user and the
+     * authenticated user.
+     * With [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts),
+     * returns the direct message space between the specified user and the calling
+     * Chat app.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * or [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + default void findDirectMessage( + com.google.chat.v1.FindDirectMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFindDirectMessageMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a human membership or app membership for the calling app. Creating
+     * memberships for other apps isn't supported. For an example, see
+     * [ Create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * When creating a membership, if the specified member has their auto-accept
+     * policy turned off, then they're invited, and must accept the space
+     * invitation before joining. Otherwise, creating a membership adds the member
+     * directly to the specified space. Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * To specify the member to add, set the `membership.member.name` in the
+     * `CreateMembershipRequest`:
+     * - To add the calling app to a space or a direct message between two human
+     *   users, use `users/app`. Unable to add other
+     *   apps to the space.
+     * - To add a human user, use `users/{user}`, where `{user}` can be the email
+     * address for the user. For users in the same Workspace organization `{user}`
+     * can also be the `id` for the person from the People API, or the `id` for
+     * the user in the Directory API. For example, if the People API Person
+     * profile ID for `user@example.com` is `123456789`, you can add the user to
+     * the space by setting the `membership.member.name` to
+     * `users/user@example.com` or `users/123456789`.
+     * 
+ */ + default void createMembership( + com.google.chat.v1.CreateMembershipRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateMembershipMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a membership. For an example, see
+     * [Delete a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void deleteMembership( + com.google.chat.v1.DeleteMembershipRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteMembershipMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a reaction and adds it to a message. For an example, see
+     * [Create a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Only unicode emoji are supported.
+     * 
+ */ + default void createReaction( + com.google.chat.v1.CreateReactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateReactionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists reactions to a message. For an example, see
+     * [List
+     * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void listReactions( + com.google.chat.v1.ListReactionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListReactionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a reaction to a message. For an example, see
+     * [Delete a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + default void deleteReaction( + com.google.chat.v1.DeleteReactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteReactionMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ChatService. + * + *
+   * Enables developers to build Chat apps and
+   * integrations on Google Chat Platform.
+   * 
+ */ + public abstract static class ChatServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ChatServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ChatService. + * + *
+   * Enables developers to build Chat apps and
+   * integrations on Google Chat Platform.
+   * 
+ */ + public static final class ChatServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ChatServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ChatServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ChatServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a message in a Google Chat space. For an example, see [Create a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/create).
+     * Calling this method requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth) and
+     * supports the following authentication types:
+     * - For text messages, user authentication or app authentication are
+     * supported.
+     * - For card messages, only app authentication is supported. (Only Chat apps
+     * can create card messages.)
+     * 
+ */ + public void createMessage( + com.google.chat.v1.CreateMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateMessageMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists messages in a space that the caller is a member of, including
+     * messages from blocked members and spaces. For an example, see
+     * [List messages](/chat/api/guides/v1/messages/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void listMessages( + com.google.chat.v1.ListMessagesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMessagesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists memberships in a space. For an example, see [List
+     * memberships](https://developers.google.com/chat/api/guides/v1/members/list).
+     * Listing memberships with
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * lists memberships in spaces that the Chat app has
+     * access to, but excludes Chat app memberships,
+     * including its own. Listing memberships with
+     * [User
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * lists memberships in spaces that the authenticated user has access to.
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void listMemberships( + com.google.chat.v1.ListMembershipsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMembershipsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns details about a membership. For an example, see
+     * [Get a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void getMembership( + com.google.chat.v1.GetMembershipRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMembershipMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns details about a message.
+     * For an example, see [Read a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Note: Might return a message from a blocked member or space.
+     * 
+ */ + public void getMessage( + com.google.chat.v1.GetMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMessageMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a message. There's a difference between the `patch` and `update`
+     * methods. The `patch`
+     * method uses a `patch` request while the `update` method uses a `put`
+     * request. We recommend using the `patch` method. For an example, see
+     * [Update a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/update).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only update messages
+     * created by the calling Chat app.
+     * 
+ */ + public void updateMessage( + com.google.chat.v1.UpdateMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMessageMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a message.
+     * For an example, see [Delete a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/delete).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only delete messages
+     * created by the calling Chat app.
+     * 
+ */ + public void deleteMessage( + com.google.chat.v1.DeleteMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMessageMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the metadata of a message attachment. The attachment data is fetched
+     * using the [media
+     * API](https://developers.google.com/chat/api/reference/rest/v1/media/download).
+     * For an example, see
+     * [Get a message
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get).
+     * Requires [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + public void getAttachment( + com.google.chat.v1.GetAttachmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAttachmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Uploads an attachment. For an example, see
+     * [Upload media as a file
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload).
+     * Requires user
+     * [authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * You can upload attachments up to 200 MB. Certain file types aren't
+     * supported. For details, see [File types blocked by Google
+     * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
+     * 
+ */ + public void uploadAttachment( + com.google.chat.v1.UploadAttachmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUploadAttachmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists spaces the caller is a member of. Group chats and DMs aren't listed
+     * until the first message is sent. For an example, see
+     * [List
+     * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Lists spaces visible to the caller or authenticated user. Group chats
+     * and DMs aren't listed until the first message is sent.
+     * 
+ */ + public void listSpaces( + com.google.chat.v1.ListSpacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSpacesMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Returns details about a space. For an example, see
+     * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void getSpace( + com.google.chat.v1.GetSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSpaceMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a named space. Spaces grouped by topics aren't supported. For an
+     * example, see [Create a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/create).
+     *  If you receive the error message `ALREADY_EXISTS` when creating
+     *  a space, try a different `displayName`. An existing space within
+     *  the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void createSpace( + com.google.chat.v1.CreateSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSpaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a space and adds specified users to it. The calling user is
+     * automatically added to the space, and shouldn't be specified as a
+     * membership in the request. For an example, see
+     * [Set up a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up).
+     * To specify the human members to add, add memberships with the appropriate
+     * `member.name` in the `SetUpSpaceRequest`. To add a human user, use
+     * `users/{user}`, where `{user}` can be the email address for the user. For
+     * users in the same Workspace organization `{user}` can also be the `id` for
+     * the person from the People API, or the `id` for the user in the Directory
+     * API. For example, if the People API Person profile ID for
+     * `user@example.com` is `123456789`, you can add the user to the space by
+     * setting the `membership.member.name` to `users/user@example.com` or
+     * `users/123456789`.
+     * For a space or group chat, if the caller blocks or is blocked by some
+     * members, then those members aren't added to the created space.
+     * To create a direct message (DM) between the calling user and another human
+     * user, specify exactly one membership to represent the human user. If
+     * one user blocks the other, the request fails and the DM isn't created.
+     * To create a DM between the calling user and the calling app, set
+     * `Space.singleUserBotDm` to `true` and don't specify any memberships. You
+     * can only use this method to set up a DM with the calling app. To add the
+     * calling app as a member of a space or an existing DM between two human
+     * users, see
+     * [create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * If a DM already exists between two users, even when one user blocks the
+     * other at the time a request is made, then the existing DM is returned.
+     * Spaces with threaded replies aren't supported. If you receive the error
+     * message `ALREADY_EXISTS` when setting up a space, try a different
+     * `displayName`. An existing space within the Google Workspace organization
+     * might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void setUpSpace( + com.google.chat.v1.SetUpSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetUpSpaceMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a space. For an example, see
+     * [Update a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/update).
+     * If you're updating the `displayName` field and receive the error message
+     * `ALREADY_EXISTS`, try a different display name.. An existing space within
+     * the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void updateSpace( + com.google.chat.v1.UpdateSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSpaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a named space. Always performs a cascading delete, which means
+     * that the space's child resources—like messages posted in the space and
+     * memberships in the space—are also deleted. For an example, see
+     * [Delete a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * from a user who has permission to delete the space.
+     * 
+ */ + public void deleteSpace( + com.google.chat.v1.DeleteSpaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSpaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Completes the
+     * [import process](https://developers.google.com/chat/api/guides/import-data)
+     * for the specified space and makes it visible to users.
+     * Requires app authentication and domain-wide delegation. For more
+     * information, see [Authorize Google Chat apps to import
+     * data](https://developers.google.com/chat/api/guides/authorize-import).
+     * 
+ */ + public void completeImportSpace( + com.google.chat.v1.CompleteImportSpaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCompleteImportSpaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the existing direct message with the specified user. If no direct
+     * message space is found, returns a `404 NOT_FOUND` error. For an example,
+     * see
+     * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
+     * With [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users),
+     * returns the direct message space between the specified user and the
+     * authenticated user.
+     * With [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts),
+     * returns the direct message space between the specified user and the calling
+     * Chat app.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * or [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + public void findDirectMessage( + com.google.chat.v1.FindDirectMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFindDirectMessageMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a human membership or app membership for the calling app. Creating
+     * memberships for other apps isn't supported. For an example, see
+     * [ Create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * When creating a membership, if the specified member has their auto-accept
+     * policy turned off, then they're invited, and must accept the space
+     * invitation before joining. Otherwise, creating a membership adds the member
+     * directly to the specified space. Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * To specify the member to add, set the `membership.member.name` in the
+     * `CreateMembershipRequest`:
+     * - To add the calling app to a space or a direct message between two human
+     *   users, use `users/app`. Unable to add other
+     *   apps to the space.
+     * - To add a human user, use `users/{user}`, where `{user}` can be the email
+     * address for the user. For users in the same Workspace organization `{user}`
+     * can also be the `id` for the person from the People API, or the `id` for
+     * the user in the Directory API. For example, if the People API Person
+     * profile ID for `user@example.com` is `123456789`, you can add the user to
+     * the space by setting the `membership.member.name` to
+     * `users/user@example.com` or `users/123456789`.
+     * 
+ */ + public void createMembership( + com.google.chat.v1.CreateMembershipRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateMembershipMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a membership. For an example, see
+     * [Delete a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void deleteMembership( + com.google.chat.v1.DeleteMembershipRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMembershipMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a reaction and adds it to a message. For an example, see
+     * [Create a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Only unicode emoji are supported.
+     * 
+ */ + public void createReaction( + com.google.chat.v1.CreateReactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateReactionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists reactions to a message. For an example, see
+     * [List
+     * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void listReactions( + com.google.chat.v1.ListReactionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListReactionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a reaction to a message. For an example, see
+     * [Delete a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public void deleteReaction( + com.google.chat.v1.DeleteReactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteReactionMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ChatService. + * + *
+   * Enables developers to build Chat apps and
+   * integrations on Google Chat Platform.
+   * 
+ */ + public static final class ChatServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ChatServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ChatServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ChatServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a message in a Google Chat space. For an example, see [Create a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/create).
+     * Calling this method requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth) and
+     * supports the following authentication types:
+     * - For text messages, user authentication or app authentication are
+     * supported.
+     * - For card messages, only app authentication is supported. (Only Chat apps
+     * can create card messages.)
+     * 
+ */ + public com.google.chat.v1.Message createMessage( + com.google.chat.v1.CreateMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateMessageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists messages in a space that the caller is a member of, including
+     * messages from blocked members and spaces. For an example, see
+     * [List messages](/chat/api/guides/v1/messages/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.ListMessagesResponse listMessages( + com.google.chat.v1.ListMessagesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMessagesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists memberships in a space. For an example, see [List
+     * memberships](https://developers.google.com/chat/api/guides/v1/members/list).
+     * Listing memberships with
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * lists memberships in spaces that the Chat app has
+     * access to, but excludes Chat app memberships,
+     * including its own. Listing memberships with
+     * [User
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * lists memberships in spaces that the authenticated user has access to.
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.ListMembershipsResponse listMemberships( + com.google.chat.v1.ListMembershipsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMembershipsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns details about a membership. For an example, see
+     * [Get a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.Membership getMembership( + com.google.chat.v1.GetMembershipRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMembershipMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns details about a message.
+     * For an example, see [Read a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Note: Might return a message from a blocked member or space.
+     * 
+ */ + public com.google.chat.v1.Message getMessage(com.google.chat.v1.GetMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMessageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a message. There's a difference between the `patch` and `update`
+     * methods. The `patch`
+     * method uses a `patch` request while the `update` method uses a `put`
+     * request. We recommend using the `patch` method. For an example, see
+     * [Update a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/update).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only update messages
+     * created by the calling Chat app.
+     * 
+ */ + public com.google.chat.v1.Message updateMessage( + com.google.chat.v1.UpdateMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMessageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a message.
+     * For an example, see [Delete a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/delete).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only delete messages
+     * created by the calling Chat app.
+     * 
+ */ + public com.google.protobuf.Empty deleteMessage( + com.google.chat.v1.DeleteMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMessageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the metadata of a message attachment. The attachment data is fetched
+     * using the [media
+     * API](https://developers.google.com/chat/api/reference/rest/v1/media/download).
+     * For an example, see
+     * [Get a message
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get).
+     * Requires [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + public com.google.chat.v1.Attachment getAttachment( + com.google.chat.v1.GetAttachmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAttachmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Uploads an attachment. For an example, see
+     * [Upload media as a file
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload).
+     * Requires user
+     * [authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * You can upload attachments up to 200 MB. Certain file types aren't
+     * supported. For details, see [File types blocked by Google
+     * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
+     * 
+ */ + public com.google.chat.v1.UploadAttachmentResponse uploadAttachment( + com.google.chat.v1.UploadAttachmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUploadAttachmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists spaces the caller is a member of. Group chats and DMs aren't listed
+     * until the first message is sent. For an example, see
+     * [List
+     * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Lists spaces visible to the caller or authenticated user. Group chats
+     * and DMs aren't listed until the first message is sent.
+     * 
+ */ + public com.google.chat.v1.ListSpacesResponse listSpaces( + com.google.chat.v1.ListSpacesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSpacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns details about a space. For an example, see
+     * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.Space getSpace(com.google.chat.v1.GetSpaceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSpaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a named space. Spaces grouped by topics aren't supported. For an
+     * example, see [Create a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/create).
+     *  If you receive the error message `ALREADY_EXISTS` when creating
+     *  a space, try a different `displayName`. An existing space within
+     *  the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.Space createSpace(com.google.chat.v1.CreateSpaceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSpaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a space and adds specified users to it. The calling user is
+     * automatically added to the space, and shouldn't be specified as a
+     * membership in the request. For an example, see
+     * [Set up a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up).
+     * To specify the human members to add, add memberships with the appropriate
+     * `member.name` in the `SetUpSpaceRequest`. To add a human user, use
+     * `users/{user}`, where `{user}` can be the email address for the user. For
+     * users in the same Workspace organization `{user}` can also be the `id` for
+     * the person from the People API, or the `id` for the user in the Directory
+     * API. For example, if the People API Person profile ID for
+     * `user@example.com` is `123456789`, you can add the user to the space by
+     * setting the `membership.member.name` to `users/user@example.com` or
+     * `users/123456789`.
+     * For a space or group chat, if the caller blocks or is blocked by some
+     * members, then those members aren't added to the created space.
+     * To create a direct message (DM) between the calling user and another human
+     * user, specify exactly one membership to represent the human user. If
+     * one user blocks the other, the request fails and the DM isn't created.
+     * To create a DM between the calling user and the calling app, set
+     * `Space.singleUserBotDm` to `true` and don't specify any memberships. You
+     * can only use this method to set up a DM with the calling app. To add the
+     * calling app as a member of a space or an existing DM between two human
+     * users, see
+     * [create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * If a DM already exists between two users, even when one user blocks the
+     * other at the time a request is made, then the existing DM is returned.
+     * Spaces with threaded replies aren't supported. If you receive the error
+     * message `ALREADY_EXISTS` when setting up a space, try a different
+     * `displayName`. An existing space within the Google Workspace organization
+     * might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.Space setUpSpace(com.google.chat.v1.SetUpSpaceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetUpSpaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a space. For an example, see
+     * [Update a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/update).
+     * If you're updating the `displayName` field and receive the error message
+     * `ALREADY_EXISTS`, try a different display name.. An existing space within
+     * the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.Space updateSpace(com.google.chat.v1.UpdateSpaceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSpaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a named space. Always performs a cascading delete, which means
+     * that the space's child resources—like messages posted in the space and
+     * memberships in the space—are also deleted. For an example, see
+     * [Delete a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * from a user who has permission to delete the space.
+     * 
+ */ + public com.google.protobuf.Empty deleteSpace(com.google.chat.v1.DeleteSpaceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSpaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Completes the
+     * [import process](https://developers.google.com/chat/api/guides/import-data)
+     * for the specified space and makes it visible to users.
+     * Requires app authentication and domain-wide delegation. For more
+     * information, see [Authorize Google Chat apps to import
+     * data](https://developers.google.com/chat/api/guides/authorize-import).
+     * 
+ */ + public com.google.chat.v1.CompleteImportSpaceResponse completeImportSpace( + com.google.chat.v1.CompleteImportSpaceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCompleteImportSpaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the existing direct message with the specified user. If no direct
+     * message space is found, returns a `404 NOT_FOUND` error. For an example,
+     * see
+     * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
+     * With [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users),
+     * returns the direct message space between the specified user and the
+     * authenticated user.
+     * With [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts),
+     * returns the direct message space between the specified user and the calling
+     * Chat app.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * or [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + public com.google.chat.v1.Space findDirectMessage( + com.google.chat.v1.FindDirectMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFindDirectMessageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a human membership or app membership for the calling app. Creating
+     * memberships for other apps isn't supported. For an example, see
+     * [ Create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * When creating a membership, if the specified member has their auto-accept
+     * policy turned off, then they're invited, and must accept the space
+     * invitation before joining. Otherwise, creating a membership adds the member
+     * directly to the specified space. Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * To specify the member to add, set the `membership.member.name` in the
+     * `CreateMembershipRequest`:
+     * - To add the calling app to a space or a direct message between two human
+     *   users, use `users/app`. Unable to add other
+     *   apps to the space.
+     * - To add a human user, use `users/{user}`, where `{user}` can be the email
+     * address for the user. For users in the same Workspace organization `{user}`
+     * can also be the `id` for the person from the People API, or the `id` for
+     * the user in the Directory API. For example, if the People API Person
+     * profile ID for `user@example.com` is `123456789`, you can add the user to
+     * the space by setting the `membership.member.name` to
+     * `users/user@example.com` or `users/123456789`.
+     * 
+ */ + public com.google.chat.v1.Membership createMembership( + com.google.chat.v1.CreateMembershipRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateMembershipMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a membership. For an example, see
+     * [Delete a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.Membership deleteMembership( + com.google.chat.v1.DeleteMembershipRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMembershipMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a reaction and adds it to a message. For an example, see
+     * [Create a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Only unicode emoji are supported.
+     * 
+ */ + public com.google.chat.v1.Reaction createReaction( + com.google.chat.v1.CreateReactionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateReactionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists reactions to a message. For an example, see
+     * [List
+     * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.chat.v1.ListReactionsResponse listReactions( + com.google.chat.v1.ListReactionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListReactionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a reaction to a message. For an example, see
+     * [Delete a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.protobuf.Empty deleteReaction( + com.google.chat.v1.DeleteReactionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteReactionMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ChatService. + * + *
+   * Enables developers to build Chat apps and
+   * integrations on Google Chat Platform.
+   * 
+ */ + public static final class ChatServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ChatServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ChatServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ChatServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a message in a Google Chat space. For an example, see [Create a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/create).
+     * Calling this method requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth) and
+     * supports the following authentication types:
+     * - For text messages, user authentication or app authentication are
+     * supported.
+     * - For card messages, only app authentication is supported. (Only Chat apps
+     * can create card messages.)
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createMessage(com.google.chat.v1.CreateMessageRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateMessageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists messages in a space that the caller is a member of, including
+     * messages from blocked members and spaces. For an example, see
+     * [List messages](/chat/api/guides/v1/messages/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.chat.v1.ListMessagesResponse> + listMessages(com.google.chat.v1.ListMessagesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMessagesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists memberships in a space. For an example, see [List
+     * memberships](https://developers.google.com/chat/api/guides/v1/members/list).
+     * Listing memberships with
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * lists memberships in spaces that the Chat app has
+     * access to, but excludes Chat app memberships,
+     * including its own. Listing memberships with
+     * [User
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * lists memberships in spaces that the authenticated user has access to.
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.chat.v1.ListMembershipsResponse> + listMemberships(com.google.chat.v1.ListMembershipsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMembershipsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns details about a membership. For an example, see
+     * [Get a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getMembership(com.google.chat.v1.GetMembershipRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMembershipMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns details about a message.
+     * For an example, see [Read a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Note: Might return a message from a blocked member or space.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getMessage(com.google.chat.v1.GetMessageRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMessageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a message. There's a difference between the `patch` and `update`
+     * methods. The `patch`
+     * method uses a `patch` request while the `update` method uses a `put`
+     * request. We recommend using the `patch` method. For an example, see
+     * [Update a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/update).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only update messages
+     * created by the calling Chat app.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateMessage(com.google.chat.v1.UpdateMessageRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMessageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a message.
+     * For an example, see [Delete a
+     * message](https://developers.google.com/chat/api/guides/v1/messages/delete).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * When using app authentication, requests can only delete messages
+     * created by the calling Chat app.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteMessage(com.google.chat.v1.DeleteMessageRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMessageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the metadata of a message attachment. The attachment data is fetched
+     * using the [media
+     * API](https://developers.google.com/chat/api/reference/rest/v1/media/download).
+     * For an example, see
+     * [Get a message
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get).
+     * Requires [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getAttachment(com.google.chat.v1.GetAttachmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAttachmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Uploads an attachment. For an example, see
+     * [Upload media as a file
+     * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload).
+     * Requires user
+     * [authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * You can upload attachments up to 200 MB. Certain file types aren't
+     * supported. For details, see [File types blocked by Google
+     * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.chat.v1.UploadAttachmentResponse> + uploadAttachment(com.google.chat.v1.UploadAttachmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUploadAttachmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists spaces the caller is a member of. Group chats and DMs aren't listed
+     * until the first message is sent. For an example, see
+     * [List
+     * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Lists spaces visible to the caller or authenticated user. Group chats
+     * and DMs aren't listed until the first message is sent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + listSpaces(com.google.chat.v1.ListSpacesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSpacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns details about a space. For an example, see
+     * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get).
+     * Requires
+     * [authentication](https://developers.google.com/chat/api/guides/auth).
+     * Supports
+     * [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts)
+     * and [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getSpace( + com.google.chat.v1.GetSpaceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSpaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a named space. Spaces grouped by topics aren't supported. For an
+     * example, see [Create a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/create).
+     *  If you receive the error message `ALREADY_EXISTS` when creating
+     *  a space, try a different `displayName`. An existing space within
+     *  the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createSpace( + com.google.chat.v1.CreateSpaceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSpaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a space and adds specified users to it. The calling user is
+     * automatically added to the space, and shouldn't be specified as a
+     * membership in the request. For an example, see
+     * [Set up a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up).
+     * To specify the human members to add, add memberships with the appropriate
+     * `member.name` in the `SetUpSpaceRequest`. To add a human user, use
+     * `users/{user}`, where `{user}` can be the email address for the user. For
+     * users in the same Workspace organization `{user}` can also be the `id` for
+     * the person from the People API, or the `id` for the user in the Directory
+     * API. For example, if the People API Person profile ID for
+     * `user@example.com` is `123456789`, you can add the user to the space by
+     * setting the `membership.member.name` to `users/user@example.com` or
+     * `users/123456789`.
+     * For a space or group chat, if the caller blocks or is blocked by some
+     * members, then those members aren't added to the created space.
+     * To create a direct message (DM) between the calling user and another human
+     * user, specify exactly one membership to represent the human user. If
+     * one user blocks the other, the request fails and the DM isn't created.
+     * To create a DM between the calling user and the calling app, set
+     * `Space.singleUserBotDm` to `true` and don't specify any memberships. You
+     * can only use this method to set up a DM with the calling app. To add the
+     * calling app as a member of a space or an existing DM between two human
+     * users, see
+     * [create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * If a DM already exists between two users, even when one user blocks the
+     * other at the time a request is made, then the existing DM is returned.
+     * Spaces with threaded replies aren't supported. If you receive the error
+     * message `ALREADY_EXISTS` when setting up a space, try a different
+     * `displayName`. An existing space within the Google Workspace organization
+     * might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture setUpSpace( + com.google.chat.v1.SetUpSpaceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetUpSpaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a space. For an example, see
+     * [Update a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/update).
+     * If you're updating the `displayName` field and receive the error message
+     * `ALREADY_EXISTS`, try a different display name.. An existing space within
+     * the Google Workspace organization might already use this display name.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateSpace( + com.google.chat.v1.UpdateSpaceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSpaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a named space. Always performs a cascading delete, which means
+     * that the space's child resources—like messages posted in the space and
+     * memberships in the space—are also deleted. For an example, see
+     * [Delete a
+     * space](https://developers.google.com/chat/api/guides/v1/spaces/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * from a user who has permission to delete the space.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSpace(com.google.chat.v1.DeleteSpaceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSpaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Completes the
+     * [import process](https://developers.google.com/chat/api/guides/import-data)
+     * for the specified space and makes it visible to users.
+     * Requires app authentication and domain-wide delegation. For more
+     * information, see [Authorize Google Chat apps to import
+     * data](https://developers.google.com/chat/api/guides/authorize-import).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.chat.v1.CompleteImportSpaceResponse> + completeImportSpace(com.google.chat.v1.CompleteImportSpaceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCompleteImportSpaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the existing direct message with the specified user. If no direct
+     * message space is found, returns a `404 NOT_FOUND` error. For an example,
+     * see
+     * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
+     * With [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users),
+     * returns the direct message space between the specified user and the
+     * authenticated user.
+     * With [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts),
+     * returns the direct message space between the specified user and the calling
+     * Chat app.
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users)
+     * or [app
+     * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + findDirectMessage(com.google.chat.v1.FindDirectMessageRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFindDirectMessageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a human membership or app membership for the calling app. Creating
+     * memberships for other apps isn't supported. For an example, see
+     * [ Create a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/create).
+     * When creating a membership, if the specified member has their auto-accept
+     * policy turned off, then they're invited, and must accept the space
+     * invitation before joining. Otherwise, creating a membership adds the member
+     * directly to the specified space. Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * To specify the member to add, set the `membership.member.name` in the
+     * `CreateMembershipRequest`:
+     * - To add the calling app to a space or a direct message between two human
+     *   users, use `users/app`. Unable to add other
+     *   apps to the space.
+     * - To add a human user, use `users/{user}`, where `{user}` can be the email
+     * address for the user. For users in the same Workspace organization `{user}`
+     * can also be the `id` for the person from the People API, or the `id` for
+     * the user in the Directory API. For example, if the People API Person
+     * profile ID for `user@example.com` is `123456789`, you can add the user to
+     * the space by setting the `membership.member.name` to
+     * `users/user@example.com` or `users/123456789`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createMembership(com.google.chat.v1.CreateMembershipRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateMembershipMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a membership. For an example, see
+     * [Delete a
+     * membership](https://developers.google.com/chat/api/guides/v1/members/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteMembership(com.google.chat.v1.DeleteMembershipRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMembershipMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a reaction and adds it to a message. For an example, see
+     * [Create a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * Only unicode emoji are supported.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createReaction(com.google.chat.v1.CreateReactionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateReactionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists reactions to a message. For an example, see
+     * [List
+     * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.chat.v1.ListReactionsResponse> + listReactions(com.google.chat.v1.ListReactionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListReactionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a reaction to a message. For an example, see
+     * [Delete a
+     * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete).
+     * Requires [user
+     * authentication](https://developers.google.com/chat/api/guides/auth/users).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteReaction(com.google.chat.v1.DeleteReactionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteReactionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_MESSAGE = 0; + private static final int METHODID_LIST_MESSAGES = 1; + private static final int METHODID_LIST_MEMBERSHIPS = 2; + private static final int METHODID_GET_MEMBERSHIP = 3; + private static final int METHODID_GET_MESSAGE = 4; + private static final int METHODID_UPDATE_MESSAGE = 5; + private static final int METHODID_DELETE_MESSAGE = 6; + private static final int METHODID_GET_ATTACHMENT = 7; + private static final int METHODID_UPLOAD_ATTACHMENT = 8; + private static final int METHODID_LIST_SPACES = 9; + private static final int METHODID_GET_SPACE = 10; + private static final int METHODID_CREATE_SPACE = 11; + private static final int METHODID_SET_UP_SPACE = 12; + private static final int METHODID_UPDATE_SPACE = 13; + private static final int METHODID_DELETE_SPACE = 14; + private static final int METHODID_COMPLETE_IMPORT_SPACE = 15; + private static final int METHODID_FIND_DIRECT_MESSAGE = 16; + private static final int METHODID_CREATE_MEMBERSHIP = 17; + private static final int METHODID_DELETE_MEMBERSHIP = 18; + private static final int METHODID_CREATE_REACTION = 19; + private static final int METHODID_LIST_REACTIONS = 20; + private static final int METHODID_DELETE_REACTION = 21; + + 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_MESSAGE: + serviceImpl.createMessage( + (com.google.chat.v1.CreateMessageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_MESSAGES: + serviceImpl.listMessages( + (com.google.chat.v1.ListMessagesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_MEMBERSHIPS: + serviceImpl.listMemberships( + (com.google.chat.v1.ListMembershipsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_MEMBERSHIP: + serviceImpl.getMembership( + (com.google.chat.v1.GetMembershipRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_MESSAGE: + serviceImpl.getMessage( + (com.google.chat.v1.GetMessageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_MESSAGE: + serviceImpl.updateMessage( + (com.google.chat.v1.UpdateMessageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_MESSAGE: + serviceImpl.deleteMessage( + (com.google.chat.v1.DeleteMessageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ATTACHMENT: + serviceImpl.getAttachment( + (com.google.chat.v1.GetAttachmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPLOAD_ATTACHMENT: + serviceImpl.uploadAttachment( + (com.google.chat.v1.UploadAttachmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SPACES: + serviceImpl.listSpaces( + (com.google.chat.v1.ListSpacesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SPACE: + serviceImpl.getSpace( + (com.google.chat.v1.GetSpaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SPACE: + serviceImpl.createSpace( + (com.google.chat.v1.CreateSpaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_UP_SPACE: + serviceImpl.setUpSpace( + (com.google.chat.v1.SetUpSpaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SPACE: + serviceImpl.updateSpace( + (com.google.chat.v1.UpdateSpaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SPACE: + serviceImpl.deleteSpace( + (com.google.chat.v1.DeleteSpaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_COMPLETE_IMPORT_SPACE: + serviceImpl.completeImportSpace( + (com.google.chat.v1.CompleteImportSpaceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_FIND_DIRECT_MESSAGE: + serviceImpl.findDirectMessage( + (com.google.chat.v1.FindDirectMessageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_MEMBERSHIP: + serviceImpl.createMembership( + (com.google.chat.v1.CreateMembershipRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_MEMBERSHIP: + serviceImpl.deleteMembership( + (com.google.chat.v1.DeleteMembershipRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_REACTION: + serviceImpl.createReaction( + (com.google.chat.v1.CreateReactionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_REACTIONS: + serviceImpl.listReactions( + (com.google.chat.v1.ListReactionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_REACTION: + serviceImpl.deleteReaction( + (com.google.chat.v1.DeleteReactionRequest) 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( + getCreateMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.CreateMessageRequest, com.google.chat.v1.Message>( + service, METHODID_CREATE_MESSAGE))) + .addMethod( + getListMessagesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.ListMessagesRequest, + com.google.chat.v1.ListMessagesResponse>(service, METHODID_LIST_MESSAGES))) + .addMethod( + getListMembershipsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.ListMembershipsRequest, + com.google.chat.v1.ListMembershipsResponse>( + service, METHODID_LIST_MEMBERSHIPS))) + .addMethod( + getGetMembershipMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.GetMembershipRequest, com.google.chat.v1.Membership>( + service, METHODID_GET_MEMBERSHIP))) + .addMethod( + getGetMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.GetMessageRequest, com.google.chat.v1.Message>( + service, METHODID_GET_MESSAGE))) + .addMethod( + getUpdateMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.UpdateMessageRequest, com.google.chat.v1.Message>( + service, METHODID_UPDATE_MESSAGE))) + .addMethod( + getDeleteMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.DeleteMessageRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_MESSAGE))) + .addMethod( + getGetAttachmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.GetAttachmentRequest, com.google.chat.v1.Attachment>( + service, METHODID_GET_ATTACHMENT))) + .addMethod( + getUploadAttachmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.UploadAttachmentRequest, + com.google.chat.v1.UploadAttachmentResponse>( + service, METHODID_UPLOAD_ATTACHMENT))) + .addMethod( + getListSpacesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.ListSpacesRequest, com.google.chat.v1.ListSpacesResponse>( + service, METHODID_LIST_SPACES))) + .addMethod( + getGetSpaceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_GET_SPACE))) + .addMethod( + getCreateSpaceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_CREATE_SPACE))) + .addMethod( + getSetUpSpaceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_SET_UP_SPACE))) + .addMethod( + getUpdateSpaceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_UPDATE_SPACE))) + .addMethod( + getDeleteSpaceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.DeleteSpaceRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SPACE))) + .addMethod( + getCompleteImportSpaceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.CompleteImportSpaceRequest, + com.google.chat.v1.CompleteImportSpaceResponse>( + service, METHODID_COMPLETE_IMPORT_SPACE))) + .addMethod( + getFindDirectMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.FindDirectMessageRequest, com.google.chat.v1.Space>( + service, METHODID_FIND_DIRECT_MESSAGE))) + .addMethod( + getCreateMembershipMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.CreateMembershipRequest, com.google.chat.v1.Membership>( + service, METHODID_CREATE_MEMBERSHIP))) + .addMethod( + getDeleteMembershipMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.DeleteMembershipRequest, com.google.chat.v1.Membership>( + service, METHODID_DELETE_MEMBERSHIP))) + .addMethod( + getCreateReactionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.CreateReactionRequest, com.google.chat.v1.Reaction>( + service, METHODID_CREATE_REACTION))) + .addMethod( + getListReactionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.ListReactionsRequest, + com.google.chat.v1.ListReactionsResponse>(service, METHODID_LIST_REACTIONS))) + .addMethod( + getDeleteReactionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.chat.v1.DeleteReactionRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_REACTION))) + .build(); + } + + private abstract static class ChatServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ChatServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.chat.v1.ChatServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ChatService"); + } + } + + private static final class ChatServiceFileDescriptorSupplier + extends ChatServiceBaseDescriptorSupplier { + ChatServiceFileDescriptorSupplier() {} + } + + private static final class ChatServiceMethodDescriptorSupplier + extends ChatServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ChatServiceMethodDescriptorSupplier(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 (ChatServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ChatServiceFileDescriptorSupplier()) + .addMethod(getCreateMessageMethod()) + .addMethod(getListMessagesMethod()) + .addMethod(getListMembershipsMethod()) + .addMethod(getGetMembershipMethod()) + .addMethod(getGetMessageMethod()) + .addMethod(getUpdateMessageMethod()) + .addMethod(getDeleteMessageMethod()) + .addMethod(getGetAttachmentMethod()) + .addMethod(getUploadAttachmentMethod()) + .addMethod(getListSpacesMethod()) + .addMethod(getGetSpaceMethod()) + .addMethod(getCreateSpaceMethod()) + .addMethod(getSetUpSpaceMethod()) + .addMethod(getUpdateSpaceMethod()) + .addMethod(getDeleteSpaceMethod()) + .addMethod(getCompleteImportSpaceMethod()) + .addMethod(getFindDirectMessageMethod()) + .addMethod(getCreateMembershipMethod()) + .addMethod(getDeleteMembershipMethod()) + .addMethod(getCreateReactionMethod()) + .addMethod(getListReactionsMethod()) + .addMethod(getDeleteReactionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-chat/owlbot.py b/java-chat/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-chat/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-chat/pom.xml b/java-chat/pom.xml new file mode 100644 index 000000000000..b7d7929664ee --- /dev/null +++ b/java-chat/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-chat-parent + pom + 0.0.1-SNAPSHOT + Google Google Chat 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-chat-parent + + + + + + com.google.cloud + google-cloud-chat + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-chat-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-chat-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-chat + grpc-google-cloud-chat-v1 + proto-google-cloud-chat-v1 + google-cloud-chat-bom + + + diff --git a/java-chat/proto-google-cloud-chat-v1/clirr-ignored-differences.xml b/java-chat/proto-google-cloud-chat-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..49f6738b5836 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/clirr-ignored-differences.xml @@ -0,0 +1,33 @@ + + + + + 7012 + com/google/apps/card/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/apps/card/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/apps/card/v1/*OrBuilder + boolean has*(*) + + 7012 + com/google/chat/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/chat/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/chat/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-chat/proto-google-cloud-chat-v1/pom.xml b/java-chat/proto-google-cloud-chat-v1/pom.xml new file mode 100644 index 000000000000..16aae18e13cf --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-chat-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-chat-v1 + Proto library for google-cloud-chat + + com.google.cloud + google-cloud-chat-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-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/Action.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/Action.java new file mode 100644 index 000000000000..636adde4c482 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/Action.java @@ -0,0 +1,2898 @@ +/* + * 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/card/v1/card.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.card.v1; + +/** + * + * + *
+ * An action that describes the behavior when the form is submitted.
+ * For example, you can invoke an Apps Script script to handle the form.
+ * If the action is triggered, the form values are sent to the server.
+ *
+ * [Google Workspace Add-ons and Chat
+ * apps](https://developers.google.com/workspace/extend):
+ * 
+ * + * Protobuf type {@code google.apps.card.v1.Action} + */ +public final class Action extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.Action) + ActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Action.newBuilder() to construct. + private Action(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Action() { + function_ = ""; + parameters_ = java.util.Collections.emptyList(); + loadIndicator_ = 0; + interaction_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Action(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto.internal_static_google_apps_card_v1_Action_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.class, com.google.apps.card.v1.Action.Builder.class); + } + + /** + * + * + *
+   * Specifies the loading indicator that the action displays while
+   * making the call to the action.
+   *
+   * [Google Workspace Add-ons and Chat
+   * apps](https://developers.google.com/workspace/extend):
+   * 
+ * + * Protobuf enum {@code google.apps.card.v1.Action.LoadIndicator} + */ + public enum LoadIndicator implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Displays a spinner to indicate that content is loading.
+     * 
+ * + * SPINNER = 0; + */ + SPINNER(0), + /** + * + * + *
+     * Nothing is displayed.
+     * 
+ * + * NONE = 1; + */ + NONE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Displays a spinner to indicate that content is loading.
+     * 
+ * + * SPINNER = 0; + */ + public static final int SPINNER_VALUE = 0; + /** + * + * + *
+     * Nothing is displayed.
+     * 
+ * + * NONE = 1; + */ + public static final int NONE_VALUE = 1; + + 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 LoadIndicator 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 LoadIndicator forNumber(int value) { + switch (value) { + case 0: + return SPINNER; + case 1: + return NONE; + 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 LoadIndicator findValueByNumber(int number) { + return LoadIndicator.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.card.v1.Action.getDescriptor().getEnumTypes().get(0); + } + + private static final LoadIndicator[] VALUES = values(); + + public static LoadIndicator 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 LoadIndicator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.card.v1.Action.LoadIndicator) + } + + /** + * + * + *
+   * Optional. Required when opening a
+   * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+   *
+   * What to do in response to an interaction with a user, such as a user
+   * clicking a button in a card message.
+   *
+   * If unspecified, the app responds by executing an `action`—like opening a
+   * link or running a function—as normal.
+   *
+   * By specifying an `interaction`, the app can respond in special interactive
+   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+   * open a [dialog](https://developers.google.com/chat/how-tos/dialogs).
+   *
+   * When specified, a loading indicator isn't shown. If specified for
+   * an add-on, the entire card is stripped and nothing is shown in the client.
+   *
+   * [Google Chat apps](https://developers.google.com/chat):
+   * 
+ * + * Protobuf enum {@code google.apps.card.v1.Action.Interaction} + */ + public enum Interaction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. The `action` executes as normal.
+     * 
+ * + * INTERACTION_UNSPECIFIED = 0; + */ + INTERACTION_UNSPECIFIED(0), + /** + * + * + *
+     * Opens a [dialog](https://developers.google.com/chat/how-tos/dialogs), a
+     * windowed, card-based interface that Chat apps use to interact with users.
+     *
+     * Only supported by Chat apps in response to button-clicks on card
+     * messages. If specified for
+     * an add-on, the entire card is stripped and nothing is shown in the
+     * client.
+     *
+     * [Google Chat apps](https://developers.google.com/chat):
+     * 
+ * + * OPEN_DIALOG = 1; + */ + OPEN_DIALOG(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. The `action` executes as normal.
+     * 
+ * + * INTERACTION_UNSPECIFIED = 0; + */ + public static final int INTERACTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Opens a [dialog](https://developers.google.com/chat/how-tos/dialogs), a
+     * windowed, card-based interface that Chat apps use to interact with users.
+     *
+     * Only supported by Chat apps in response to button-clicks on card
+     * messages. If specified for
+     * an add-on, the entire card is stripped and nothing is shown in the
+     * client.
+     *
+     * [Google Chat apps](https://developers.google.com/chat):
+     * 
+ * + * OPEN_DIALOG = 1; + */ + public static final int OPEN_DIALOG_VALUE = 1; + + 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 Interaction 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 Interaction forNumber(int value) { + switch (value) { + case 0: + return INTERACTION_UNSPECIFIED; + case 1: + return OPEN_DIALOG; + 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 Interaction findValueByNumber(int number) { + return Interaction.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.card.v1.Action.getDescriptor().getEnumTypes().get(1); + } + + private static final Interaction[] VALUES = values(); + + public static Interaction 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 Interaction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.card.v1.Action.Interaction) + } + + public interface ActionParameterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.card.v1.Action.ActionParameter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the parameter for the action script.
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+     * The name of the parameter for the action script.
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * The value of the parameter.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+     * The value of the parameter.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + } + /** + * + * + *
+   * List of string parameters to supply when the action method is invoked.
+   * For example, consider three snooze buttons: snooze now, snooze one day,
+   * or snooze next week. You might use `action method = snooze()`, passing the
+   * snooze type and snooze time in the list of string parameters.
+   *
+   * To learn more, see
+   * [`CommonEventObject`](https://developers.google.com/chat/api/reference/rest/v1/Event#commoneventobject).
+   *
+   * [Google Workspace Add-ons and Chat
+   * apps](https://developers.google.com/workspace/extend):
+   * 
+ * + * Protobuf type {@code google.apps.card.v1.Action.ActionParameter} + */ + public static final class ActionParameter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.Action.ActionParameter) + ActionParameterOrBuilder { + private static final long serialVersionUID = 0L; + // Use ActionParameter.newBuilder() to construct. + private ActionParameter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ActionParameter() { + key_ = ""; + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ActionParameter(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.ActionParameter.class, + com.google.apps.card.v1.Action.ActionParameter.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * + * + *
+     * The name of the parameter for the action script.
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the parameter for the action script.
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + /** + * + * + *
+     * The value of the parameter.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + * + * + *
+     * The value of the parameter.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + 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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + 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.card.v1.Action.ActionParameter)) { + return super.equals(obj); + } + com.google.apps.card.v1.Action.ActionParameter other = + (com.google.apps.card.v1.Action.ActionParameter) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValue().equals(other.getValue())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action.ActionParameter 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.card.v1.Action.ActionParameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action.ActionParameter 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.card.v1.Action.ActionParameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action.ActionParameter 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.card.v1.Action.ActionParameter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action.ActionParameter 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.card.v1.Action.ActionParameter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action.ActionParameter 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.card.v1.Action.ActionParameter 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; + } + /** + * + * + *
+     * List of string parameters to supply when the action method is invoked.
+     * For example, consider three snooze buttons: snooze now, snooze one day,
+     * or snooze next week. You might use `action method = snooze()`, passing the
+     * snooze type and snooze time in the list of string parameters.
+     *
+     * To learn more, see
+     * [`CommonEventObject`](https://developers.google.com/chat/api/reference/rest/v1/Event#commoneventobject).
+     *
+     * [Google Workspace Add-ons and Chat
+     * apps](https://developers.google.com/workspace/extend):
+     * 
+ * + * Protobuf type {@code google.apps.card.v1.Action.ActionParameter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.Action.ActionParameter) + com.google.apps.card.v1.Action.ActionParameterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.ActionParameter.class, + com.google.apps.card.v1.Action.ActionParameter.Builder.class); + } + + // Construct using com.google.apps.card.v1.Action.ActionParameter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter getDefaultInstanceForType() { + return com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter build() { + com.google.apps.card.v1.Action.ActionParameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter buildPartial() { + com.google.apps.card.v1.Action.ActionParameter result = + new com.google.apps.card.v1.Action.ActionParameter(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.card.v1.Action.ActionParameter result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @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.card.v1.Action.ActionParameter) { + return mergeFrom((com.google.apps.card.v1.Action.ActionParameter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.Action.ActionParameter other) { + if (other == com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+       * The name of the parameter for the action script.
+       * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the parameter for the action script.
+       * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the parameter for the action script.
+       * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the parameter for the action script.
+       * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the parameter for the action script.
+       * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+       * The value of the parameter.
+       * 
+ * + * string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The value of the parameter.
+       * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The value of the parameter.
+       * 
+ * + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the parameter.
+       * 
+ * + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the parameter.
+       * 
+ * + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = 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.card.v1.Action.ActionParameter) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.Action.ActionParameter) + private static final com.google.apps.card.v1.Action.ActionParameter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.Action.ActionParameter(); + } + + public static com.google.apps.card.v1.Action.ActionParameter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActionParameter 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.card.v1.Action.ActionParameter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FUNCTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object function_ = ""; + /** + * + * + *
+   * A custom function to invoke when the containing element is
+   * clicked or othrwise activated.
+   *
+   * For example usage, see [Create interactive
+   * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+   * 
+ * + * string function = 1; + * + * @return The function. + */ + @java.lang.Override + public java.lang.String getFunction() { + java.lang.Object ref = function_; + 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(); + function_ = s; + return s; + } + } + /** + * + * + *
+   * A custom function to invoke when the containing element is
+   * clicked or othrwise activated.
+   *
+   * For example usage, see [Create interactive
+   * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+   * 
+ * + * string function = 1; + * + * @return The bytes for function. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFunctionBytes() { + java.lang.Object ref = function_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + function_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List parameters_; + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public java.util.List getParametersList() { + return parameters_; + } + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public java.util.List + getParametersOrBuilderList() { + return parameters_; + } + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public int getParametersCount() { + return parameters_.size(); + } + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter getParameters(int index) { + return parameters_.get(index); + } + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameterOrBuilder getParametersOrBuilder(int index) { + return parameters_.get(index); + } + + public static final int LOAD_INDICATOR_FIELD_NUMBER = 3; + private int loadIndicator_ = 0; + /** + * + * + *
+   * Specifies the loading indicator that the action displays while
+   * making the call to the action.
+   * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The enum numeric value on the wire for loadIndicator. + */ + @java.lang.Override + public int getLoadIndicatorValue() { + return loadIndicator_; + } + /** + * + * + *
+   * Specifies the loading indicator that the action displays while
+   * making the call to the action.
+   * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The loadIndicator. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.LoadIndicator getLoadIndicator() { + com.google.apps.card.v1.Action.LoadIndicator result = + com.google.apps.card.v1.Action.LoadIndicator.forNumber(loadIndicator_); + return result == null ? com.google.apps.card.v1.Action.LoadIndicator.UNRECOGNIZED : result; + } + + public static final int PERSIST_VALUES_FIELD_NUMBER = 4; + private boolean persistValues_ = false; + /** + * + * + *
+   * Indicates whether form values persist after the action. The default value
+   * is `false`.
+   *
+   * If `true`, form values remain after the action is triggered. To let the
+   * user make changes while the action is being processed, set
+   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+   * to `NONE`. For [card
+   * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create)
+   * in Chat apps, you must also set the action's
+   * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype)
+   * to `UPDATE_MESSAGE` and use the same
+   * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId)
+   * from the card that contained the action.
+   *
+   * If `false`, the form values are cleared when the action is triggered.
+   * To prevent the user from making changes while the action is being
+   * processed, set
+   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+   * to `SPINNER`.
+   * 
+ * + * bool persist_values = 4; + * + * @return The persistValues. + */ + @java.lang.Override + public boolean getPersistValues() { + return persistValues_; + } + + public static final int INTERACTION_FIELD_NUMBER = 5; + private int interaction_ = 0; + /** + * + * + *
+   * Optional. Required when opening a
+   * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+   *
+   * What to do in response to an interaction with a user, such as a user
+   * clicking a button in a card message.
+   *
+   * If unspecified, the app responds by executing an `action`—like opening a
+   * link or running a function—as normal.
+   *
+   * By specifying an `interaction`, the app can respond in special interactive
+   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+   * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+   * specified, a loading indicator isn't shown. If specified for
+   * an add-on, the entire card is stripped and nothing is shown in the client.
+   *
+   * [Google Chat apps](https://developers.google.com/chat):
+   * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The enum numeric value on the wire for interaction. + */ + @java.lang.Override + public int getInteractionValue() { + return interaction_; + } + /** + * + * + *
+   * Optional. Required when opening a
+   * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+   *
+   * What to do in response to an interaction with a user, such as a user
+   * clicking a button in a card message.
+   *
+   * If unspecified, the app responds by executing an `action`—like opening a
+   * link or running a function—as normal.
+   *
+   * By specifying an `interaction`, the app can respond in special interactive
+   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+   * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+   * specified, a loading indicator isn't shown. If specified for
+   * an add-on, the entire card is stripped and nothing is shown in the client.
+   *
+   * [Google Chat apps](https://developers.google.com/chat):
+   * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The interaction. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.Interaction getInteraction() { + com.google.apps.card.v1.Action.Interaction result = + com.google.apps.card.v1.Action.Interaction.forNumber(interaction_); + return result == null ? com.google.apps.card.v1.Action.Interaction.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(function_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, function_); + } + for (int i = 0; i < parameters_.size(); i++) { + output.writeMessage(2, parameters_.get(i)); + } + if (loadIndicator_ != com.google.apps.card.v1.Action.LoadIndicator.SPINNER.getNumber()) { + output.writeEnum(3, loadIndicator_); + } + if (persistValues_ != false) { + output.writeBool(4, persistValues_); + } + if (interaction_ + != com.google.apps.card.v1.Action.Interaction.INTERACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(5, interaction_); + } + 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(function_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, function_); + } + for (int i = 0; i < parameters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parameters_.get(i)); + } + if (loadIndicator_ != com.google.apps.card.v1.Action.LoadIndicator.SPINNER.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, loadIndicator_); + } + if (persistValues_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, persistValues_); + } + if (interaction_ + != com.google.apps.card.v1.Action.Interaction.INTERACTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, interaction_); + } + 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.card.v1.Action)) { + return super.equals(obj); + } + com.google.apps.card.v1.Action other = (com.google.apps.card.v1.Action) obj; + + if (!getFunction().equals(other.getFunction())) return false; + if (!getParametersList().equals(other.getParametersList())) return false; + if (loadIndicator_ != other.loadIndicator_) return false; + if (getPersistValues() != other.getPersistValues()) return false; + if (interaction_ != other.interaction_) 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) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + if (getParametersCount() > 0) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParametersList().hashCode(); + } + hash = (37 * hash) + LOAD_INDICATOR_FIELD_NUMBER; + hash = (53 * hash) + loadIndicator_; + hash = (37 * hash) + PERSIST_VALUES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPersistValues()); + hash = (37 * hash) + INTERACTION_FIELD_NUMBER; + hash = (53 * hash) + interaction_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.Action parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action 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.card.v1.Action parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action 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.card.v1.Action parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Action parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action 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.card.v1.Action parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action 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.card.v1.Action parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action 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.card.v1.Action 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; + } + /** + * + * + *
+   * An action that describes the behavior when the form is submitted.
+   * For example, you can invoke an Apps Script script to handle the form.
+   * If the action is triggered, the form values are sent to the server.
+   *
+   * [Google Workspace Add-ons and Chat
+   * apps](https://developers.google.com/workspace/extend):
+   * 
+ * + * Protobuf type {@code google.apps.card.v1.Action} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.Action) + com.google.apps.card.v1.ActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.class, com.google.apps.card.v1.Action.Builder.class); + } + + // Construct using com.google.apps.card.v1.Action.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + function_ = ""; + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + } else { + parameters_ = null; + parametersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + loadIndicator_ = 0; + persistValues_ = false; + interaction_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.Action getDefaultInstanceForType() { + return com.google.apps.card.v1.Action.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.Action build() { + com.google.apps.card.v1.Action result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.Action buildPartial() { + com.google.apps.card.v1.Action result = new com.google.apps.card.v1.Action(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.apps.card.v1.Action result) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + parameters_ = java.util.Collections.unmodifiableList(parameters_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.build(); + } + } + + private void buildPartial0(com.google.apps.card.v1.Action result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.function_ = function_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.loadIndicator_ = loadIndicator_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.persistValues_ = persistValues_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.interaction_ = interaction_; + } + } + + @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.card.v1.Action) { + return mergeFrom((com.google.apps.card.v1.Action) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.Action other) { + if (other == com.google.apps.card.v1.Action.getDefaultInstance()) return this; + if (!other.getFunction().isEmpty()) { + function_ = other.function_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (parametersBuilder_ == null) { + if (!other.parameters_.isEmpty()) { + if (parameters_.isEmpty()) { + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureParametersIsMutable(); + parameters_.addAll(other.parameters_); + } + onChanged(); + } + } else { + if (!other.parameters_.isEmpty()) { + if (parametersBuilder_.isEmpty()) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000002); + parametersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getParametersFieldBuilder() + : null; + } else { + parametersBuilder_.addAllMessages(other.parameters_); + } + } + } + if (other.loadIndicator_ != 0) { + setLoadIndicatorValue(other.getLoadIndicatorValue()); + } + if (other.getPersistValues() != false) { + setPersistValues(other.getPersistValues()); + } + if (other.interaction_ != 0) { + setInteractionValue(other.getInteractionValue()); + } + 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: + { + function_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.apps.card.v1.Action.ActionParameter m = + input.readMessage( + com.google.apps.card.v1.Action.ActionParameter.parser(), extensionRegistry); + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(m); + } else { + parametersBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + loadIndicator_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + persistValues_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + interaction_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object function_ = ""; + /** + * + * + *
+     * A custom function to invoke when the containing element is
+     * clicked or othrwise activated.
+     *
+     * For example usage, see [Create interactive
+     * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+     * 
+ * + * string function = 1; + * + * @return The function. + */ + public java.lang.String getFunction() { + java.lang.Object ref = function_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + function_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A custom function to invoke when the containing element is
+     * clicked or othrwise activated.
+     *
+     * For example usage, see [Create interactive
+     * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+     * 
+ * + * string function = 1; + * + * @return The bytes for function. + */ + public com.google.protobuf.ByteString getFunctionBytes() { + java.lang.Object ref = function_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + function_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A custom function to invoke when the containing element is
+     * clicked or othrwise activated.
+     *
+     * For example usage, see [Create interactive
+     * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+     * 
+ * + * string function = 1; + * + * @param value The function to set. + * @return This builder for chaining. + */ + public Builder setFunction(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + function_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A custom function to invoke when the containing element is
+     * clicked or othrwise activated.
+     *
+     * For example usage, see [Create interactive
+     * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+     * 
+ * + * string function = 1; + * + * @return This builder for chaining. + */ + public Builder clearFunction() { + function_ = getDefaultInstance().getFunction(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A custom function to invoke when the containing element is
+     * clicked or othrwise activated.
+     *
+     * For example usage, see [Create interactive
+     * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+     * 
+ * + * string function = 1; + * + * @param value The bytes for function to set. + * @return This builder for chaining. + */ + public Builder setFunctionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + function_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List parameters_ = + java.util.Collections.emptyList(); + + private void ensureParametersIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + parameters_ = + new java.util.ArrayList(parameters_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.apps.card.v1.Action.ActionParameter, + com.google.apps.card.v1.Action.ActionParameter.Builder, + com.google.apps.card.v1.Action.ActionParameterOrBuilder> + parametersBuilder_; + + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public java.util.List getParametersList() { + if (parametersBuilder_ == null) { + return java.util.Collections.unmodifiableList(parameters_); + } else { + return parametersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public int getParametersCount() { + if (parametersBuilder_ == null) { + return parameters_.size(); + } else { + return parametersBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter getParameters(int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder setParameters(int index, com.google.apps.card.v1.Action.ActionParameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.set(index, value); + onChanged(); + } else { + parametersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder setParameters( + int index, com.google.apps.card.v1.Action.ActionParameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.set(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters(com.google.apps.card.v1.Action.ActionParameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + } else { + parametersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters(int index, com.google.apps.card.v1.Action.ActionParameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(index, value); + onChanged(); + } else { + parametersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters( + com.google.apps.card.v1.Action.ActionParameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters( + int index, com.google.apps.card.v1.Action.ActionParameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addAllParameters( + java.lang.Iterable values) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parameters_); + onChanged(); + } else { + parametersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + parametersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder removeParameters(int index) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.remove(index); + onChanged(); + } else { + parametersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter.Builder getParametersBuilder(int index) { + return getParametersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameterOrBuilder getParametersOrBuilder( + int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public java.util.List + getParametersOrBuilderList() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parameters_); + } + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter.Builder addParametersBuilder() { + return getParametersFieldBuilder() + .addBuilder(com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance()); + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter.Builder addParametersBuilder(int index) { + return getParametersFieldBuilder() + .addBuilder(index, com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance()); + } + /** + * + * + *
+     * List of action parameters.
+     * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public java.util.List + getParametersBuilderList() { + return getParametersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.apps.card.v1.Action.ActionParameter, + com.google.apps.card.v1.Action.ActionParameter.Builder, + com.google.apps.card.v1.Action.ActionParameterOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.apps.card.v1.Action.ActionParameter, + com.google.apps.card.v1.Action.ActionParameter.Builder, + com.google.apps.card.v1.Action.ActionParameterOrBuilder>( + parameters_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private int loadIndicator_ = 0; + /** + * + * + *
+     * Specifies the loading indicator that the action displays while
+     * making the call to the action.
+     * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The enum numeric value on the wire for loadIndicator. + */ + @java.lang.Override + public int getLoadIndicatorValue() { + return loadIndicator_; + } + /** + * + * + *
+     * Specifies the loading indicator that the action displays while
+     * making the call to the action.
+     * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @param value The enum numeric value on the wire for loadIndicator to set. + * @return This builder for chaining. + */ + public Builder setLoadIndicatorValue(int value) { + loadIndicator_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the loading indicator that the action displays while
+     * making the call to the action.
+     * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The loadIndicator. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.LoadIndicator getLoadIndicator() { + com.google.apps.card.v1.Action.LoadIndicator result = + com.google.apps.card.v1.Action.LoadIndicator.forNumber(loadIndicator_); + return result == null ? com.google.apps.card.v1.Action.LoadIndicator.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Specifies the loading indicator that the action displays while
+     * making the call to the action.
+     * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @param value The loadIndicator to set. + * @return This builder for chaining. + */ + public Builder setLoadIndicator(com.google.apps.card.v1.Action.LoadIndicator value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + loadIndicator_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the loading indicator that the action displays while
+     * making the call to the action.
+     * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return This builder for chaining. + */ + public Builder clearLoadIndicator() { + bitField0_ = (bitField0_ & ~0x00000004); + loadIndicator_ = 0; + onChanged(); + return this; + } + + private boolean persistValues_; + /** + * + * + *
+     * Indicates whether form values persist after the action. The default value
+     * is `false`.
+     *
+     * If `true`, form values remain after the action is triggered. To let the
+     * user make changes while the action is being processed, set
+     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+     * to `NONE`. For [card
+     * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create)
+     * in Chat apps, you must also set the action's
+     * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype)
+     * to `UPDATE_MESSAGE` and use the same
+     * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId)
+     * from the card that contained the action.
+     *
+     * If `false`, the form values are cleared when the action is triggered.
+     * To prevent the user from making changes while the action is being
+     * processed, set
+     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+     * to `SPINNER`.
+     * 
+ * + * bool persist_values = 4; + * + * @return The persistValues. + */ + @java.lang.Override + public boolean getPersistValues() { + return persistValues_; + } + /** + * + * + *
+     * Indicates whether form values persist after the action. The default value
+     * is `false`.
+     *
+     * If `true`, form values remain after the action is triggered. To let the
+     * user make changes while the action is being processed, set
+     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+     * to `NONE`. For [card
+     * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create)
+     * in Chat apps, you must also set the action's
+     * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype)
+     * to `UPDATE_MESSAGE` and use the same
+     * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId)
+     * from the card that contained the action.
+     *
+     * If `false`, the form values are cleared when the action is triggered.
+     * To prevent the user from making changes while the action is being
+     * processed, set
+     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+     * to `SPINNER`.
+     * 
+ * + * bool persist_values = 4; + * + * @param value The persistValues to set. + * @return This builder for chaining. + */ + public Builder setPersistValues(boolean value) { + + persistValues_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether form values persist after the action. The default value
+     * is `false`.
+     *
+     * If `true`, form values remain after the action is triggered. To let the
+     * user make changes while the action is being processed, set
+     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+     * to `NONE`. For [card
+     * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create)
+     * in Chat apps, you must also set the action's
+     * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype)
+     * to `UPDATE_MESSAGE` and use the same
+     * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId)
+     * from the card that contained the action.
+     *
+     * If `false`, the form values are cleared when the action is triggered.
+     * To prevent the user from making changes while the action is being
+     * processed, set
+     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+     * to `SPINNER`.
+     * 
+ * + * bool persist_values = 4; + * + * @return This builder for chaining. + */ + public Builder clearPersistValues() { + bitField0_ = (bitField0_ & ~0x00000008); + persistValues_ = false; + onChanged(); + return this; + } + + private int interaction_ = 0; + /** + * + * + *
+     * Optional. Required when opening a
+     * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+     *
+     * What to do in response to an interaction with a user, such as a user
+     * clicking a button in a card message.
+     *
+     * If unspecified, the app responds by executing an `action`—like opening a
+     * link or running a function—as normal.
+     *
+     * By specifying an `interaction`, the app can respond in special interactive
+     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+     * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+     * specified, a loading indicator isn't shown. If specified for
+     * an add-on, the entire card is stripped and nothing is shown in the client.
+     *
+     * [Google Chat apps](https://developers.google.com/chat):
+     * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The enum numeric value on the wire for interaction. + */ + @java.lang.Override + public int getInteractionValue() { + return interaction_; + } + /** + * + * + *
+     * Optional. Required when opening a
+     * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+     *
+     * What to do in response to an interaction with a user, such as a user
+     * clicking a button in a card message.
+     *
+     * If unspecified, the app responds by executing an `action`—like opening a
+     * link or running a function—as normal.
+     *
+     * By specifying an `interaction`, the app can respond in special interactive
+     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+     * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+     * specified, a loading indicator isn't shown. If specified for
+     * an add-on, the entire card is stripped and nothing is shown in the client.
+     *
+     * [Google Chat apps](https://developers.google.com/chat):
+     * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @param value The enum numeric value on the wire for interaction to set. + * @return This builder for chaining. + */ + public Builder setInteractionValue(int value) { + interaction_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required when opening a
+     * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+     *
+     * What to do in response to an interaction with a user, such as a user
+     * clicking a button in a card message.
+     *
+     * If unspecified, the app responds by executing an `action`—like opening a
+     * link or running a function—as normal.
+     *
+     * By specifying an `interaction`, the app can respond in special interactive
+     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+     * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+     * specified, a loading indicator isn't shown. If specified for
+     * an add-on, the entire card is stripped and nothing is shown in the client.
+     *
+     * [Google Chat apps](https://developers.google.com/chat):
+     * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The interaction. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.Interaction getInteraction() { + com.google.apps.card.v1.Action.Interaction result = + com.google.apps.card.v1.Action.Interaction.forNumber(interaction_); + return result == null ? com.google.apps.card.v1.Action.Interaction.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Required when opening a
+     * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+     *
+     * What to do in response to an interaction with a user, such as a user
+     * clicking a button in a card message.
+     *
+     * If unspecified, the app responds by executing an `action`—like opening a
+     * link or running a function—as normal.
+     *
+     * By specifying an `interaction`, the app can respond in special interactive
+     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+     * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+     * specified, a loading indicator isn't shown. If specified for
+     * an add-on, the entire card is stripped and nothing is shown in the client.
+     *
+     * [Google Chat apps](https://developers.google.com/chat):
+     * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @param value The interaction to set. + * @return This builder for chaining. + */ + public Builder setInteraction(com.google.apps.card.v1.Action.Interaction value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + interaction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required when opening a
+     * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+     *
+     * What to do in response to an interaction with a user, such as a user
+     * clicking a button in a card message.
+     *
+     * If unspecified, the app responds by executing an `action`—like opening a
+     * link or running a function—as normal.
+     *
+     * By specifying an `interaction`, the app can respond in special interactive
+     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+     * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+     * specified, a loading indicator isn't shown. If specified for
+     * an add-on, the entire card is stripped and nothing is shown in the client.
+     *
+     * [Google Chat apps](https://developers.google.com/chat):
+     * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return This builder for chaining. + */ + public Builder clearInteraction() { + bitField0_ = (bitField0_ & ~0x00000010); + interaction_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.card.v1.Action) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.Action) + private static final com.google.apps.card.v1.Action DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.Action(); + } + + public static com.google.apps.card.v1.Action getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Action 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.card.v1.Action getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/ActionOrBuilder.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/ActionOrBuilder.java new file mode 100644 index 000000000000..1358940129e9 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/ActionOrBuilder.java @@ -0,0 +1,224 @@ +/* + * 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/card/v1/card.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.card.v1; + +public interface ActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.card.v1.Action) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A custom function to invoke when the containing element is
+   * clicked or othrwise activated.
+   *
+   * For example usage, see [Create interactive
+   * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+   * 
+ * + * string function = 1; + * + * @return The function. + */ + java.lang.String getFunction(); + /** + * + * + *
+   * A custom function to invoke when the containing element is
+   * clicked or othrwise activated.
+   *
+   * For example usage, see [Create interactive
+   * cards](https://developers.google.com/chat/how-tos/cards-onclick).
+   * 
+ * + * string function = 1; + * + * @return The bytes for function. + */ + com.google.protobuf.ByteString getFunctionBytes(); + + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + java.util.List getParametersList(); + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + com.google.apps.card.v1.Action.ActionParameter getParameters(int index); + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + int getParametersCount(); + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + java.util.List + getParametersOrBuilderList(); + /** + * + * + *
+   * List of action parameters.
+   * 
+ * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + com.google.apps.card.v1.Action.ActionParameterOrBuilder getParametersOrBuilder(int index); + + /** + * + * + *
+   * Specifies the loading indicator that the action displays while
+   * making the call to the action.
+   * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The enum numeric value on the wire for loadIndicator. + */ + int getLoadIndicatorValue(); + /** + * + * + *
+   * Specifies the loading indicator that the action displays while
+   * making the call to the action.
+   * 
+ * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The loadIndicator. + */ + com.google.apps.card.v1.Action.LoadIndicator getLoadIndicator(); + + /** + * + * + *
+   * Indicates whether form values persist after the action. The default value
+   * is `false`.
+   *
+   * If `true`, form values remain after the action is triggered. To let the
+   * user make changes while the action is being processed, set
+   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+   * to `NONE`. For [card
+   * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create)
+   * in Chat apps, you must also set the action's
+   * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype)
+   * to `UPDATE_MESSAGE` and use the same
+   * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId)
+   * from the card that contained the action.
+   *
+   * If `false`, the form values are cleared when the action is triggered.
+   * To prevent the user from making changes while the action is being
+   * processed, set
+   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
+   * to `SPINNER`.
+   * 
+ * + * bool persist_values = 4; + * + * @return The persistValues. + */ + boolean getPersistValues(); + + /** + * + * + *
+   * Optional. Required when opening a
+   * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+   *
+   * What to do in response to an interaction with a user, such as a user
+   * clicking a button in a card message.
+   *
+   * If unspecified, the app responds by executing an `action`—like opening a
+   * link or running a function—as normal.
+   *
+   * By specifying an `interaction`, the app can respond in special interactive
+   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+   * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+   * specified, a loading indicator isn't shown. If specified for
+   * an add-on, the entire card is stripped and nothing is shown in the client.
+   *
+   * [Google Chat apps](https://developers.google.com/chat):
+   * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The enum numeric value on the wire for interaction. + */ + int getInteractionValue(); + /** + * + * + *
+   * Optional. Required when opening a
+   * [dialog](https://developers.google.com/chat/how-tos/dialogs).
+   *
+   * What to do in response to an interaction with a user, such as a user
+   * clicking a button in a card message.
+   *
+   * If unspecified, the app responds by executing an `action`—like opening a
+   * link or running a function—as normal.
+   *
+   * By specifying an `interaction`, the app can respond in special interactive
+   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
+   * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When
+   * specified, a loading indicator isn't shown. If specified for
+   * an add-on, the entire card is stripped and nothing is shown in the client.
+   *
+   * [Google Chat apps](https://developers.google.com/chat):
+   * 
+ * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The interaction. + */ + com.google.apps.card.v1.Action.Interaction getInteraction(); +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/BorderStyle.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/BorderStyle.java new file mode 100644 index 000000000000..91a97a9842c5 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/BorderStyle.java @@ -0,0 +1,1118 @@ +/* + * 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/card/v1/card.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.card.v1; + +/** + * + * + *
+ * The style options for the border of a card or widget, including the border
+ * type and color.
+ *
+ * [Google Workspace Add-ons and Chat
+ * apps](https://developers.google.com/workspace/extend):
+ * 
+ * + * Protobuf type {@code google.apps.card.v1.BorderStyle} + */ +public final class BorderStyle extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.BorderStyle) + BorderStyleOrBuilder { + private static final long serialVersionUID = 0L; + // Use BorderStyle.newBuilder() to construct. + private BorderStyle(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BorderStyle() { + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BorderStyle(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.BorderStyle.class, + com.google.apps.card.v1.BorderStyle.Builder.class); + } + + /** + * + * + *
+   * Represents the border types applied to widgets.
+   *
+   * [Google Workspace Add-ons
+   * and Chat apps](https://developers.google.com/workspace/extend):
+   * 
+ * + * Protobuf enum {@code google.apps.card.v1.BorderStyle.BorderType} + */ + public enum BorderType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Don't use. Unspecified.
+     * 
+ * + * BORDER_TYPE_UNSPECIFIED = 0; + */ + BORDER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Default value. No border.
+     * 
+ * + * NO_BORDER = 1; + */ + NO_BORDER(1), + /** + * + * + *
+     * Outline.
+     * 
+ * + * STROKE = 2; + */ + STROKE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Don't use. Unspecified.
+     * 
+ * + * BORDER_TYPE_UNSPECIFIED = 0; + */ + public static final int BORDER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Default value. No border.
+     * 
+ * + * NO_BORDER = 1; + */ + public static final int NO_BORDER_VALUE = 1; + /** + * + * + *
+     * Outline.
+     * 
+ * + * STROKE = 2; + */ + public static final int STROKE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BorderType 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 BorderType forNumber(int value) { + switch (value) { + case 0: + return BORDER_TYPE_UNSPECIFIED; + case 1: + return NO_BORDER; + case 2: + return STROKE; + 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 BorderType findValueByNumber(int number) { + return BorderType.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.card.v1.BorderStyle.getDescriptor().getEnumTypes().get(0); + } + + private static final BorderType[] VALUES = values(); + + public static BorderType 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 BorderType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.card.v1.BorderStyle.BorderType) + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + /** + * + * + *
+   * The border type.
+   * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * The border type.
+   * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.apps.card.v1.BorderStyle.BorderType getType() { + com.google.apps.card.v1.BorderStyle.BorderType result = + com.google.apps.card.v1.BorderStyle.BorderType.forNumber(type_); + return result == null ? com.google.apps.card.v1.BorderStyle.BorderType.UNRECOGNIZED : result; + } + + public static final int STROKE_COLOR_FIELD_NUMBER = 2; + private com.google.type.Color strokeColor_; + /** + * + * + *
+   * The colors to use when the type is `BORDER_TYPE_STROKE`.
+   * 
+ * + * .google.type.Color stroke_color = 2; + * + * @return Whether the strokeColor field is set. + */ + @java.lang.Override + public boolean hasStrokeColor() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The colors to use when the type is `BORDER_TYPE_STROKE`.
+   * 
+ * + * .google.type.Color stroke_color = 2; + * + * @return The strokeColor. + */ + @java.lang.Override + public com.google.type.Color getStrokeColor() { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } + /** + * + * + *
+   * The colors to use when the type is `BORDER_TYPE_STROKE`.
+   * 
+ * + * .google.type.Color stroke_color = 2; + */ + @java.lang.Override + public com.google.type.ColorOrBuilder getStrokeColorOrBuilder() { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } + + public static final int CORNER_RADIUS_FIELD_NUMBER = 3; + private int cornerRadius_ = 0; + /** + * + * + *
+   * The corner radius for the border.
+   * 
+ * + * int32 corner_radius = 3; + * + * @return The cornerRadius. + */ + @java.lang.Override + public int getCornerRadius() { + return cornerRadius_; + } + + 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 (type_ + != com.google.apps.card.v1.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStrokeColor()); + } + if (cornerRadius_ != 0) { + output.writeInt32(3, cornerRadius_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.apps.card.v1.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStrokeColor()); + } + if (cornerRadius_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, cornerRadius_); + } + 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.card.v1.BorderStyle)) { + return super.equals(obj); + } + com.google.apps.card.v1.BorderStyle other = (com.google.apps.card.v1.BorderStyle) obj; + + if (type_ != other.type_) return false; + if (hasStrokeColor() != other.hasStrokeColor()) return false; + if (hasStrokeColor()) { + if (!getStrokeColor().equals(other.getStrokeColor())) return false; + } + if (getCornerRadius() != other.getCornerRadius()) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasStrokeColor()) { + hash = (37 * hash) + STROKE_COLOR_FIELD_NUMBER; + hash = (53 * hash) + getStrokeColor().hashCode(); + } + hash = (37 * hash) + CORNER_RADIUS_FIELD_NUMBER; + hash = (53 * hash) + getCornerRadius(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.BorderStyle parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.BorderStyle 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.card.v1.BorderStyle parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.BorderStyle 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.card.v1.BorderStyle parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.BorderStyle 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.card.v1.BorderStyle parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.BorderStyle 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.card.v1.BorderStyle parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.BorderStyle 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.card.v1.BorderStyle 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 style options for the border of a card or widget, including the border
+   * type and color.
+   *
+   * [Google Workspace Add-ons and Chat
+   * apps](https://developers.google.com/workspace/extend):
+   * 
+ * + * Protobuf type {@code google.apps.card.v1.BorderStyle} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.BorderStyle) + com.google.apps.card.v1.BorderStyleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.BorderStyle.class, + com.google.apps.card.v1.BorderStyle.Builder.class); + } + + // Construct using com.google.apps.card.v1.BorderStyle.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStrokeColorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + strokeColor_ = null; + if (strokeColorBuilder_ != null) { + strokeColorBuilder_.dispose(); + strokeColorBuilder_ = null; + } + cornerRadius_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.BorderStyle getDefaultInstanceForType() { + return com.google.apps.card.v1.BorderStyle.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.BorderStyle build() { + com.google.apps.card.v1.BorderStyle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.BorderStyle buildPartial() { + com.google.apps.card.v1.BorderStyle result = new com.google.apps.card.v1.BorderStyle(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.card.v1.BorderStyle result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.strokeColor_ = + strokeColorBuilder_ == null ? strokeColor_ : strokeColorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cornerRadius_ = cornerRadius_; + } + 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.card.v1.BorderStyle) { + return mergeFrom((com.google.apps.card.v1.BorderStyle) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.BorderStyle other) { + if (other == com.google.apps.card.v1.BorderStyle.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasStrokeColor()) { + mergeStrokeColor(other.getStrokeColor()); + } + if (other.getCornerRadius() != 0) { + setCornerRadius(other.getCornerRadius()); + } + 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: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getStrokeColorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + cornerRadius_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int type_ = 0; + /** + * + * + *
+     * The border type.
+     * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The border type.
+     * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The border type.
+     * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.apps.card.v1.BorderStyle.BorderType getType() { + com.google.apps.card.v1.BorderStyle.BorderType result = + com.google.apps.card.v1.BorderStyle.BorderType.forNumber(type_); + return result == null ? com.google.apps.card.v1.BorderStyle.BorderType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The border type.
+     * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.apps.card.v1.BorderStyle.BorderType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The border type.
+     * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private com.google.type.Color strokeColor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + strokeColorBuilder_; + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + * + * @return Whether the strokeColor field is set. + */ + public boolean hasStrokeColor() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + * + * @return The strokeColor. + */ + public com.google.type.Color getStrokeColor() { + if (strokeColorBuilder_ == null) { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } else { + return strokeColorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + */ + public Builder setStrokeColor(com.google.type.Color value) { + if (strokeColorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + strokeColor_ = value; + } else { + strokeColorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + */ + public Builder setStrokeColor(com.google.type.Color.Builder builderForValue) { + if (strokeColorBuilder_ == null) { + strokeColor_ = builderForValue.build(); + } else { + strokeColorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + */ + public Builder mergeStrokeColor(com.google.type.Color value) { + if (strokeColorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && strokeColor_ != null + && strokeColor_ != com.google.type.Color.getDefaultInstance()) { + getStrokeColorBuilder().mergeFrom(value); + } else { + strokeColor_ = value; + } + } else { + strokeColorBuilder_.mergeFrom(value); + } + if (strokeColor_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + */ + public Builder clearStrokeColor() { + bitField0_ = (bitField0_ & ~0x00000002); + strokeColor_ = null; + if (strokeColorBuilder_ != null) { + strokeColorBuilder_.dispose(); + strokeColorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + */ + public com.google.type.Color.Builder getStrokeColorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStrokeColorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + */ + public com.google.type.ColorOrBuilder getStrokeColorOrBuilder() { + if (strokeColorBuilder_ != null) { + return strokeColorBuilder_.getMessageOrBuilder(); + } else { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } + } + /** + * + * + *
+     * The colors to use when the type is `BORDER_TYPE_STROKE`.
+     * 
+ * + * .google.type.Color stroke_color = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + getStrokeColorFieldBuilder() { + if (strokeColorBuilder_ == null) { + strokeColorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, + com.google.type.Color.Builder, + com.google.type.ColorOrBuilder>( + getStrokeColor(), getParentForChildren(), isClean()); + strokeColor_ = null; + } + return strokeColorBuilder_; + } + + private int cornerRadius_; + /** + * + * + *
+     * The corner radius for the border.
+     * 
+ * + * int32 corner_radius = 3; + * + * @return The cornerRadius. + */ + @java.lang.Override + public int getCornerRadius() { + return cornerRadius_; + } + /** + * + * + *
+     * The corner radius for the border.
+     * 
+ * + * int32 corner_radius = 3; + * + * @param value The cornerRadius to set. + * @return This builder for chaining. + */ + public Builder setCornerRadius(int value) { + + cornerRadius_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The corner radius for the border.
+     * 
+ * + * int32 corner_radius = 3; + * + * @return This builder for chaining. + */ + public Builder clearCornerRadius() { + bitField0_ = (bitField0_ & ~0x00000004); + cornerRadius_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.apps.card.v1.BorderStyle) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.BorderStyle) + private static final com.google.apps.card.v1.BorderStyle DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.BorderStyle(); + } + + public static com.google.apps.card.v1.BorderStyle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BorderStyle 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.card.v1.BorderStyle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/BorderStyleOrBuilder.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/BorderStyleOrBuilder.java new file mode 100644 index 000000000000..044befc5c3c0 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/BorderStyleOrBuilder.java @@ -0,0 +1,99 @@ +/* + * 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/card/v1/card.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.card.v1; + +public interface BorderStyleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.card.v1.BorderStyle) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The border type.
+   * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * The border type.
+   * 
+ * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The type. + */ + com.google.apps.card.v1.BorderStyle.BorderType getType(); + + /** + * + * + *
+   * The colors to use when the type is `BORDER_TYPE_STROKE`.
+   * 
+ * + * .google.type.Color stroke_color = 2; + * + * @return Whether the strokeColor field is set. + */ + boolean hasStrokeColor(); + /** + * + * + *
+   * The colors to use when the type is `BORDER_TYPE_STROKE`.
+   * 
+ * + * .google.type.Color stroke_color = 2; + * + * @return The strokeColor. + */ + com.google.type.Color getStrokeColor(); + /** + * + * + *
+   * The colors to use when the type is `BORDER_TYPE_STROKE`.
+   * 
+ * + * .google.type.Color stroke_color = 2; + */ + com.google.type.ColorOrBuilder getStrokeColorOrBuilder(); + + /** + * + * + *
+   * The corner radius for the border.
+   * 
+ * + * int32 corner_radius = 3; + * + * @return The cornerRadius. + */ + int getCornerRadius(); +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/Button.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/Button.java new file mode 100644 index 000000000000..3a4ba0a1f928 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/apps/card/v1/Button.java @@ -0,0 +1,2134 @@ +/* + * 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/card/v1/card.proto + +// Protobuf Java Version: 3.25.2 +package com.google.apps.card.v1; + +/** + * + * + *
+ * A text, icon, or text and icon button that users can click. For an example in
+ * Google Chat apps, see
+ * [Button list](https://developers.google.com/chat/ui/widgets/button-list).
+ *
+ * To make an image a clickable button, specify an
+ * [`Image`][google.apps.card.v1.Image] (not an
+ * [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an
+ * `onClick` action.
+ *
+ * [Google Workspace
+ * Add-ons and Chat apps](https://developers.google.com/workspace/extend):
+ * 
+ * + * Protobuf type {@code google.apps.card.v1.Button} + */ +public final class Button extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.Button) + ButtonOrBuilder { + private static final long serialVersionUID = 0L; + // Use Button.newBuilder() to construct. + private Button(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Button() { + text_ = ""; + altText_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Button(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto.internal_static_google_apps_card_v1_Button_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Button.class, com.google.apps.card.v1.Button.Builder.class); + } + + private int bitField0_; + public static final int TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object text_ = ""; + /** + * + * + *
+   * The text displayed inside the button.
+   * 
+ * + * string text = 1; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + * + * + *
+   * The text displayed inside the button.
+   * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ICON_FIELD_NUMBER = 2; + private com.google.apps.card.v1.Icon icon_; + /** + * + * + *
+   * The icon image. If both `icon` and `text` are set, then the icon appears
+   * before the text.
+   * 
+ * + * .google.apps.card.v1.Icon icon = 2; + * + * @return Whether the icon field is set. + */ + @java.lang.Override + public boolean hasIcon() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The icon image. If both `icon` and `text` are set, then the icon appears
+   * before the text.
+   * 
+ * + * .google.apps.card.v1.Icon icon = 2; + * + * @return The icon. + */ + @java.lang.Override + public com.google.apps.card.v1.Icon getIcon() { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } + /** + * + * + *
+   * The icon image. If both `icon` and `text` are set, then the icon appears
+   * before the text.
+   * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + @java.lang.Override + public com.google.apps.card.v1.IconOrBuilder getIconOrBuilder() { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } + + public static final int COLOR_FIELD_NUMBER = 3; + private com.google.type.Color color_; + /** + * + * + *
+   * If set, the button is filled with a solid background color and the font
+   * color changes to maintain contrast with the background color. For example,
+   * setting a blue background likely results in white text.
+   *
+   * If unset, the image background is white and the font color is blue.
+   *
+   * For red, green, and blue, the value of each field is a `float` number that
+   * you can express in either of two ways: as a number between 0 and 255
+   * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+   * the absence of a color and 1 or 255/255 represent the full presence of that
+   * color on the RGB scale.
+   *
+   * Optionally set `alpha`, which sets a level of transparency using this
+   * equation:
+   *
+   * ```
+   * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+   * ```
+   *
+   * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+   * `0` corresponds with a completely transparent color.
+   *
+   * For example, the following color represents a half transparent red:
+   *
+   * ```
+   * "color": {
+   *    "red": 1,
+   *    "green": 0,
+   *    "blue": 0,
+   *    "alpha": 0.5
+   * }
+   * ```
+   * 
+ * + * .google.type.Color color = 3; + * + * @return Whether the color field is set. + */ + @java.lang.Override + public boolean hasColor() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * If set, the button is filled with a solid background color and the font
+   * color changes to maintain contrast with the background color. For example,
+   * setting a blue background likely results in white text.
+   *
+   * If unset, the image background is white and the font color is blue.
+   *
+   * For red, green, and blue, the value of each field is a `float` number that
+   * you can express in either of two ways: as a number between 0 and 255
+   * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+   * the absence of a color and 1 or 255/255 represent the full presence of that
+   * color on the RGB scale.
+   *
+   * Optionally set `alpha`, which sets a level of transparency using this
+   * equation:
+   *
+   * ```
+   * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+   * ```
+   *
+   * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+   * `0` corresponds with a completely transparent color.
+   *
+   * For example, the following color represents a half transparent red:
+   *
+   * ```
+   * "color": {
+   *    "red": 1,
+   *    "green": 0,
+   *    "blue": 0,
+   *    "alpha": 0.5
+   * }
+   * ```
+   * 
+ * + * .google.type.Color color = 3; + * + * @return The color. + */ + @java.lang.Override + public com.google.type.Color getColor() { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + /** + * + * + *
+   * If set, the button is filled with a solid background color and the font
+   * color changes to maintain contrast with the background color. For example,
+   * setting a blue background likely results in white text.
+   *
+   * If unset, the image background is white and the font color is blue.
+   *
+   * For red, green, and blue, the value of each field is a `float` number that
+   * you can express in either of two ways: as a number between 0 and 255
+   * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+   * the absence of a color and 1 or 255/255 represent the full presence of that
+   * color on the RGB scale.
+   *
+   * Optionally set `alpha`, which sets a level of transparency using this
+   * equation:
+   *
+   * ```
+   * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+   * ```
+   *
+   * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+   * `0` corresponds with a completely transparent color.
+   *
+   * For example, the following color represents a half transparent red:
+   *
+   * ```
+   * "color": {
+   *    "red": 1,
+   *    "green": 0,
+   *    "blue": 0,
+   *    "alpha": 0.5
+   * }
+   * ```
+   * 
+ * + * .google.type.Color color = 3; + */ + @java.lang.Override + public com.google.type.ColorOrBuilder getColorOrBuilder() { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + + public static final int ON_CLICK_FIELD_NUMBER = 4; + private com.google.apps.card.v1.OnClick onClick_; + /** + * + * + *
+   * Required. The action to perform when a user clicks the button, such as
+   * opening a hyperlink or running a custom function.
+   * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return Whether the onClick field is set. + */ + @java.lang.Override + public boolean hasOnClick() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Required. The action to perform when a user clicks the button, such as
+   * opening a hyperlink or running a custom function.
+   * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return The onClick. + */ + @java.lang.Override + public com.google.apps.card.v1.OnClick getOnClick() { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } + /** + * + * + *
+   * Required. The action to perform when a user clicks the button, such as
+   * opening a hyperlink or running a custom function.
+   * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + @java.lang.Override + public com.google.apps.card.v1.OnClickOrBuilder getOnClickOrBuilder() { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } + + public static final int DISABLED_FIELD_NUMBER = 5; + private boolean disabled_ = false; + /** + * + * + *
+   * If `true`, the button is displayed in an inactive state and doesn't respond
+   * to user actions.
+   * 
+ * + * bool disabled = 5; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int ALT_TEXT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object altText_ = ""; + /** + * + * + *
+   * The alternative text that's used for accessibility.
+   *
+   * Set descriptive text that lets users know what the button does. For
+   * example, if a button opens a hyperlink, you might write: "Opens a new
+   * browser tab and navigates to the Google Chat developer documentation at
+   * https://developers.google.com/chat".
+   * 
+ * + * string alt_text = 6; + * + * @return The altText. + */ + @java.lang.Override + public java.lang.String getAltText() { + java.lang.Object ref = altText_; + 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(); + altText_ = s; + return s; + } + } + /** + * + * + *
+   * The alternative text that's used for accessibility.
+   *
+   * Set descriptive text that lets users know what the button does. For
+   * example, if a button opens a hyperlink, you might write: "Opens a new
+   * browser tab and navigates to the Google Chat developer documentation at
+   * https://developers.google.com/chat".
+   * 
+ * + * string alt_text = 6; + * + * @return The bytes for altText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAltTextBytes() { + java.lang.Object ref = altText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + altText_ = 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(text_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getIcon()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getColor()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getOnClick()); + } + if (disabled_ != false) { + output.writeBool(5, disabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(altText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, altText_); + } + 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(text_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIcon()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getColor()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOnClick()); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, disabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(altText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, altText_); + } + 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.card.v1.Button)) { + return super.equals(obj); + } + com.google.apps.card.v1.Button other = (com.google.apps.card.v1.Button) obj; + + if (!getText().equals(other.getText())) return false; + if (hasIcon() != other.hasIcon()) return false; + if (hasIcon()) { + if (!getIcon().equals(other.getIcon())) return false; + } + if (hasColor() != other.hasColor()) return false; + if (hasColor()) { + if (!getColor().equals(other.getColor())) return false; + } + if (hasOnClick() != other.hasOnClick()) return false; + if (hasOnClick()) { + if (!getOnClick().equals(other.getOnClick())) return false; + } + if (getDisabled() != other.getDisabled()) return false; + if (!getAltText().equals(other.getAltText())) 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) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + if (hasIcon()) { + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + } + if (hasColor()) { + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + } + if (hasOnClick()) { + hash = (37 * hash) + ON_CLICK_FIELD_NUMBER; + hash = (53 * hash) + getOnClick().hashCode(); + } + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + hash = (37 * hash) + ALT_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getAltText().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.Button parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Button 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.card.v1.Button parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Button 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.card.v1.Button parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Button parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Button parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Button 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.card.v1.Button parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Button 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.card.v1.Button parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Button 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.card.v1.Button 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 text, icon, or text and icon button that users can click. For an example in
+   * Google Chat apps, see
+   * [Button list](https://developers.google.com/chat/ui/widgets/button-list).
+   *
+   * To make an image a clickable button, specify an
+   * [`Image`][google.apps.card.v1.Image] (not an
+   * [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an
+   * `onClick` action.
+   *
+   * [Google Workspace
+   * Add-ons and Chat apps](https://developers.google.com/workspace/extend):
+   * 
+ * + * Protobuf type {@code google.apps.card.v1.Button} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.Button) + com.google.apps.card.v1.ButtonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Button.class, com.google.apps.card.v1.Button.Builder.class); + } + + // Construct using com.google.apps.card.v1.Button.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIconFieldBuilder(); + getColorFieldBuilder(); + getOnClickFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = ""; + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + color_ = null; + if (colorBuilder_ != null) { + colorBuilder_.dispose(); + colorBuilder_ = null; + } + onClick_ = null; + if (onClickBuilder_ != null) { + onClickBuilder_.dispose(); + onClickBuilder_ = null; + } + disabled_ = false; + altText_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.Button getDefaultInstanceForType() { + return com.google.apps.card.v1.Button.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.Button build() { + com.google.apps.card.v1.Button result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.Button buildPartial() { + com.google.apps.card.v1.Button result = new com.google.apps.card.v1.Button(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.card.v1.Button result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.text_ = text_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.icon_ = iconBuilder_ == null ? icon_ : iconBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.color_ = colorBuilder_ == null ? color_ : colorBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.onClick_ = onClickBuilder_ == null ? onClick_ : onClickBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disabled_ = disabled_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.altText_ = altText_; + } + 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.card.v1.Button) { + return mergeFrom((com.google.apps.card.v1.Button) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.Button other) { + if (other == com.google.apps.card.v1.Button.getDefaultInstance()) return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasIcon()) { + mergeIcon(other.getIcon()); + } + if (other.hasColor()) { + mergeColor(other.getColor()); + } + if (other.hasOnClick()) { + mergeOnClick(other.getOnClick()); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (!other.getAltText().isEmpty()) { + altText_ = other.altText_; + bitField0_ |= 0x00000020; + 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: + { + text_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getIconFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getColorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getOnClickFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + altText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object text_ = ""; + /** + * + * + *
+     * The text displayed inside the button.
+     * 
+ * + * string text = 1; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The text displayed inside the button.
+     * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The text displayed inside the button.
+     * 
+ * + * string text = 1; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The text displayed inside the button.
+     * 
+ * + * string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = getDefaultInstance().getText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The text displayed inside the button.
+     * 
+ * + * string text = 1; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.apps.card.v1.Icon icon_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.card.v1.Icon, + com.google.apps.card.v1.Icon.Builder, + com.google.apps.card.v1.IconOrBuilder> + iconBuilder_; + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + * + * @return Whether the icon field is set. + */ + public boolean hasIcon() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + * + * @return The icon. + */ + public com.google.apps.card.v1.Icon getIcon() { + if (iconBuilder_ == null) { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } else { + return iconBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder setIcon(com.google.apps.card.v1.Icon value) { + if (iconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + icon_ = value; + } else { + iconBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder setIcon(com.google.apps.card.v1.Icon.Builder builderForValue) { + if (iconBuilder_ == null) { + icon_ = builderForValue.build(); + } else { + iconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder mergeIcon(com.google.apps.card.v1.Icon value) { + if (iconBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && icon_ != null + && icon_ != com.google.apps.card.v1.Icon.getDefaultInstance()) { + getIconBuilder().mergeFrom(value); + } else { + icon_ = value; + } + } else { + iconBuilder_.mergeFrom(value); + } + if (icon_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder clearIcon() { + bitField0_ = (bitField0_ & ~0x00000002); + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + public com.google.apps.card.v1.Icon.Builder getIconBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getIconFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + public com.google.apps.card.v1.IconOrBuilder getIconOrBuilder() { + if (iconBuilder_ != null) { + return iconBuilder_.getMessageOrBuilder(); + } else { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } + } + /** + * + * + *
+     * The icon image. If both `icon` and `text` are set, then the icon appears
+     * before the text.
+     * 
+ * + * .google.apps.card.v1.Icon icon = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.card.v1.Icon, + com.google.apps.card.v1.Icon.Builder, + com.google.apps.card.v1.IconOrBuilder> + getIconFieldBuilder() { + if (iconBuilder_ == null) { + iconBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.card.v1.Icon, + com.google.apps.card.v1.Icon.Builder, + com.google.apps.card.v1.IconOrBuilder>( + getIcon(), getParentForChildren(), isClean()); + icon_ = null; + } + return iconBuilder_; + } + + private com.google.type.Color color_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + colorBuilder_; + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + * + * @return Whether the color field is set. + */ + public boolean hasColor() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + * + * @return The color. + */ + public com.google.type.Color getColor() { + if (colorBuilder_ == null) { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } else { + return colorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + */ + public Builder setColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + color_ = value; + } else { + colorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + */ + public Builder setColor(com.google.type.Color.Builder builderForValue) { + if (colorBuilder_ == null) { + color_ = builderForValue.build(); + } else { + colorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + */ + public Builder mergeColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && color_ != null + && color_ != com.google.type.Color.getDefaultInstance()) { + getColorBuilder().mergeFrom(value); + } else { + color_ = value; + } + } else { + colorBuilder_.mergeFrom(value); + } + if (color_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + */ + public Builder clearColor() { + bitField0_ = (bitField0_ & ~0x00000004); + color_ = null; + if (colorBuilder_ != null) { + colorBuilder_.dispose(); + colorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + */ + public com.google.type.Color.Builder getColorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getColorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + */ + public com.google.type.ColorOrBuilder getColorOrBuilder() { + if (colorBuilder_ != null) { + return colorBuilder_.getMessageOrBuilder(); + } else { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + } + /** + * + * + *
+     * If set, the button is filled with a solid background color and the font
+     * color changes to maintain contrast with the background color. For example,
+     * setting a blue background likely results in white text.
+     *
+     * If unset, the image background is white and the font color is blue.
+     *
+     * For red, green, and blue, the value of each field is a `float` number that
+     * you can express in either of two ways: as a number between 0 and 255
+     * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
+     * the absence of a color and 1 or 255/255 represent the full presence of that
+     * color on the RGB scale.
+     *
+     * Optionally set `alpha`, which sets a level of transparency using this
+     * equation:
+     *
+     * ```
+     * pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
+     * ```
+     *
+     * For `alpha`, a value of `1` corresponds with a solid color, and a value of
+     * `0` corresponds with a completely transparent color.
+     *
+     * For example, the following color represents a half transparent red:
+     *
+     * ```
+     * "color": {
+     *    "red": 1,
+     *    "green": 0,
+     *    "blue": 0,
+     *    "alpha": 0.5
+     * }
+     * ```
+     * 
+ * + * .google.type.Color color = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + getColorFieldBuilder() { + if (colorBuilder_ == null) { + colorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Color, + com.google.type.Color.Builder, + com.google.type.ColorOrBuilder>(getColor(), getParentForChildren(), isClean()); + color_ = null; + } + return colorBuilder_; + } + + private com.google.apps.card.v1.OnClick onClick_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.card.v1.OnClick, + com.google.apps.card.v1.OnClick.Builder, + com.google.apps.card.v1.OnClickOrBuilder> + onClickBuilder_; + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return Whether the onClick field is set. + */ + public boolean hasOnClick() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return The onClick. + */ + public com.google.apps.card.v1.OnClick getOnClick() { + if (onClickBuilder_ == null) { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } else { + return onClickBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder setOnClick(com.google.apps.card.v1.OnClick value) { + if (onClickBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + onClick_ = value; + } else { + onClickBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder setOnClick(com.google.apps.card.v1.OnClick.Builder builderForValue) { + if (onClickBuilder_ == null) { + onClick_ = builderForValue.build(); + } else { + onClickBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder mergeOnClick(com.google.apps.card.v1.OnClick value) { + if (onClickBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && onClick_ != null + && onClick_ != com.google.apps.card.v1.OnClick.getDefaultInstance()) { + getOnClickBuilder().mergeFrom(value); + } else { + onClick_ = value; + } + } else { + onClickBuilder_.mergeFrom(value); + } + if (onClick_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder clearOnClick() { + bitField0_ = (bitField0_ & ~0x00000008); + onClick_ = null; + if (onClickBuilder_ != null) { + onClickBuilder_.dispose(); + onClickBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public com.google.apps.card.v1.OnClick.Builder getOnClickBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getOnClickFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public com.google.apps.card.v1.OnClickOrBuilder getOnClickOrBuilder() { + if (onClickBuilder_ != null) { + return onClickBuilder_.getMessageOrBuilder(); + } else { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } + } + /** + * + * + *
+     * Required. The action to perform when a user clicks the button, such as
+     * opening a hyperlink or running a custom function.
+     * 
+ * + * .google.apps.card.v1.OnClick on_click = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.card.v1.OnClick, + com.google.apps.card.v1.OnClick.Builder, + com.google.apps.card.v1.OnClickOrBuilder> + getOnClickFieldBuilder() { + if (onClickBuilder_ == null) { + onClickBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.apps.card.v1.OnClick, + com.google.apps.card.v1.OnClick.Builder, + com.google.apps.card.v1.OnClickOrBuilder>( + getOnClick(), getParentForChildren(), isClean()); + onClick_ = null; + } + return onClickBuilder_; + } + + private boolean disabled_; + /** + * + * + *
+     * If `true`, the button is displayed in an inactive state and doesn't respond
+     * to user actions.
+     * 
+ * + * bool disabled = 5; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + /** + * + * + *
+     * If `true`, the button is displayed in an inactive state and doesn't respond
+     * to user actions.
+     * 
+ * + * bool disabled = 5; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * If `true`, the button is displayed in an inactive state and doesn't respond
+     * to user actions.
+     * 
+ * + * bool disabled = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000010); + disabled_ = false; + onChanged(); + return this; + } + + private java.lang.Object altText_ = ""; + /** + * + * + *
+     * The alternative text that's used for accessibility.
+     *
+     * Set descriptive text that lets users know what the button does. For
+     * example, if a button opens a hyperlink, you might write: "Opens a new
+     * browser tab and navigates to the Google Chat developer documentation at
+     * https://developers.google.com/chat".
+     * 
+ * + * string alt_text = 6; + * + * @return The altText. + */ + public java.lang.String getAltText() { + java.lang.Object ref = altText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + altText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The alternative text that's used for accessibility.
+     *
+     * Set descriptive text that lets users know what the button does. For
+     * example, if a button opens a hyperlink, you might write: "Opens a new
+     * browser tab and navigates to the Google Chat developer documentation at
+     * https://developers.google.com/chat".
+     * 
+ * + * string alt_text = 6; + * + * @return The bytes for altText. + */ + public com.google.protobuf.ByteString getAltTextBytes() { + java.lang.Object ref = altText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + altText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The alternative text that's used for accessibility.
+     *
+     * Set descriptive text that lets users know what the button does. For
+     * example, if a button opens a hyperlink, you might write: "Opens a new
+     * browser tab and navigates to the Google Chat developer documentation at
+     * https://developers.google.com/chat".
+     * 
+ * + * string alt_text = 6; + * + * @param value The altText to set. + * @return This builder for chaining. + */ + public Builder setAltText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + altText_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The alternative text that's used for accessibility.
+     *
+     * Set descriptive text that lets users know what the button does. For
+     * example, if a button opens a hyperlink, you might write: "Opens a new
+     * browser tab and navigates to the Google Chat developer documentation at
+     * https://developers.google.com/chat".
+     * 
+ * + * string alt_text = 6; + * + * @return This builder for chaining. + */ + public Builder clearAltText() { + altText_ = getDefaultInstance().getAltText(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The alternative text that's used for accessibility.
+     *
+     * Set descriptive text that lets users know what the button does. For
+     * example, if a button opens a hyperlink, you might write: "Opens a new
+     * browser tab and navigates to the Google Chat developer documentation at
+     * https://developers.google.com/chat".
+     * 
+ * + * string alt_text = 6; + * + * @param value The bytes for altText to set. + * @return This builder for chaining. + */ + public Builder setAltTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + altText_ = value; + bitField0_ |= 0x00000020; + 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.card.v1.Button) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.Button) + private static final com.google.apps.card.v1.Button DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.Button(); + } + + public static com.google.apps.card.v1.Button getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser