public static final class ChatServiceGrpc.ChatServiceFutureStub extends AbstractFutureStub<ChatServiceGrpc.ChatServiceFutureStub>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.
Inheritance
java.lang.Object > io.grpc.stub.AbstractStub > io.grpc.stub.AbstractFutureStub > ChatServiceGrpc.ChatServiceFutureStubMethods
build(Channel channel, CallOptions callOptions)
protected ChatServiceGrpc.ChatServiceFutureStub build(Channel channel, CallOptions callOptions)| Parameters | |
|---|---|
| Name | Description | 
| channel | io.grpc.Channel | 
| callOptions | io.grpc.CallOptions | 
| Returns | |
|---|---|
| Type | Description | 
| ChatServiceGrpc.ChatServiceFutureStub | |
completeImportSpace(CompleteImportSpaceRequest request)
public ListenableFuture<CompleteImportSpaceResponse> completeImportSpace(CompleteImportSpaceRequest request)Completes the import process for the specified space and makes it visible to users. Requires user authentication and domain-wide delegation with the authorization scope:
- https://www.googleapis.com/auth/chat.importFor more information, see Authorize Google Chat apps to import data.
| Parameter | |
|---|---|
| Name | Description | 
| request | CompleteImportSpaceRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<CompleteImportSpaceResponse> | |
createCustomEmoji(CreateCustomEmojiRequest request)
public ListenableFuture<CustomEmoji> createCustomEmoji(CreateCustomEmojiRequest request)Creates a custom emoji. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions. Requires user authentication with the authorization scope:
| Parameter | |
|---|---|
| Name | Description | 
| request | CreateCustomEmojiRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<CustomEmoji> | |
createMembership(CreateMembershipRequest request)
public ListenableFuture<Membership> createMembership(CreateMembershipRequest request)Creates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. 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. Supports the following types of authentication:
- App authentication with administrator approval and the authorization scope:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.memberships
- https://www.googleapis.com/auth/chat.memberships.app(to add the calling app to the space)
- https://www.googleapis.com/auth/chat.import(import mode spaces only)
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and the following authorization scope is used:- https://www.googleapis.com/auth/chat.admin.membershipsApp authentication is not supported for the following use cases:
 
 
- Inviting users external to the Workspace organization that owns the space.
- Adding a Google Group to a space.
- Adding a Chat app to a space. For example usage, see:
- Invite or add a user to a space.
- Invite or add a Google Group to a space.
- Add the Chat app to a space.
| Parameter | |
|---|---|
| Name | Description | 
| request | CreateMembershipRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Membership> | |
createMessage(CreateMessageRequest request)
public ListenableFuture<Message> createMessage(CreateMessageRequest request)Creates a message in a Google Chat space. For an example, see Send a message. Supports the following types of authentication:
- App authentication with the authorization scope:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.messages.create
- https://www.googleapis.com/auth/chat.messages
- https://www.googleapis.com/auth/chat.import(import mode spaces only) Chat attributes the message sender differently depending on the type of authentication that you use in your request. The following image shows how Chat attributes a message when you use app authentication. Chat displays the Chat app as the message sender. The content of the message can contain text (- text), cards (- cardsV2), and accessory widgets (- accessoryWidgets). !Message sent with app authentication The following image shows how Chat attributes a message when you use user authentication. Chat displays the user as the message sender and attributes the Chat app to the message by displaying its name. The content of message can only contain text (- text). !Message sent with user authentication The maximum message size, including the message contents, is 32,000 bytes. For webhook requests, the response doesn't contain the full message. The response only populates the- nameand- thread.namefields in addition to the information that was in the request.
 
| Parameter | |
|---|---|
| Name | Description | 
| request | CreateMessageRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Message> | |
createReaction(CreateReactionRequest request)
public ListenableFuture<Reaction> createReaction(CreateReactionRequest request)Creates a reaction and adds it to a message. For an example, see Add a reaction to a message. Requires user authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | CreateReactionRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Reaction> | |
createSpace(CreateSpaceRequest request)
public ListenableFuture<Space> createSpace(CreateSpaceRequest request) Creates a space. Can be used to create a named space, or a
 group chat in Import mode. For an example, see Create a
 space.
 Supports the following types of
 authentication:
- App authentication with administrator approval and one of the following authorization scopes:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.spaces.create
- https://www.googleapis.com/auth/chat.spaces
- https://www.googleapis.com/auth/chat.import(import mode spaces only) When authenticating as an app, the- space.customerfield must be set in the request. When authenticating as an app, the Chat app is added as a member of the space. However, unlike human authentication, the Chat app is not added as a space manager. By default, the Chat app can be removed from the space by all space members. To allow only space managers to remove the app from a space, set- space.permission_settings.manage_appsto- managers_allowed. Space membership upon creation depends on whether the space is created in- Import mode:
 
- Import mode: No members are created.
- All other modes:  The calling user is added as a member. This is:- The app itself when using app authentication.
- The human user when using user authentication.
If you receive the error message ALREADY_EXISTSwhen creating a space, try a differentdisplayName. An existing space within the Google Workspace organization might already use this display name.
 
| Parameter | |
|---|---|
| Name | Description | 
| request | CreateSpaceRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Space> | |
deleteCustomEmoji(DeleteCustomEmojiRequest request)
public ListenableFuture<Empty> deleteCustomEmoji(DeleteCustomEmojiRequest request)Deletes a custom emoji. By default, users can only delete custom emoji they created. Emoji managers assigned by the administrator can delete any custom emoji in the organization. See Learn about custom emojis in Google Chat. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions. Requires user authentication with the authorization scope:
| Parameter | |
|---|---|
| Name | Description | 
| request | DeleteCustomEmojiRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Empty> | |
deleteMembership(DeleteMembershipRequest request)
public ListenableFuture<Membership> deleteMembership(DeleteMembershipRequest request)Deletes a membership. For an example, see Remove a user or a Google Chat app from a space. Supports the following types of authentication:
- App authentication with administrator approval and the authorization scope:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.memberships
- https://www.googleapis.com/auth/chat.memberships.app(to remove the calling app from the space)
- https://www.googleapis.com/auth/chat.import(import mode spaces only)
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and the following authorization scope is used:- https://www.googleapis.com/auth/chat.admin.membershipsApp authentication is not supported for the following use cases:
 
 
- Removing a Google Group from a space.
- Removing a Chat app from a space. To delete memberships for space managers, the requester must be a space manager. If you're using app authentication the Chat app must be the space creator.
| Parameter | |
|---|---|
| Name | Description | 
| request | DeleteMembershipRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Membership> | |
deleteMessage(DeleteMessageRequest request)
public ListenableFuture<Empty> deleteMessage(DeleteMessageRequest request)Deletes a message. For an example, see Delete a message. Supports the following types of authentication:
- App authentication with the authorization scope:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.messages
- https://www.googleapis.com/auth/chat.import(import mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app.
 
| Parameter | |
|---|---|
| Name | Description | 
| request | DeleteMessageRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Empty> | |
deleteReaction(DeleteReactionRequest request)
public ListenableFuture<Empty> deleteReaction(DeleteReactionRequest request)Deletes a reaction to a message. For an example, see Delete a reaction. Requires user authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | DeleteReactionRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Empty> | |
deleteSpace(DeleteSpaceRequest request)
public ListenableFuture<Empty> deleteSpace(DeleteSpaceRequest 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. Supports the following types of authentication:
- App
authentication
with administrator
approval and the
authorization scope:- https://www.googleapis.com/auth/chat.app.delete(only in spaces the app created)
 
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.delete
- https://www.googleapis.com/auth/chat.import(import mode spaces only)
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and the following authorization scope is used:
 
| Parameter | |
|---|---|
| Name | Description | 
| request | DeleteSpaceRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Empty> | |
findDirectMessage(FindDirectMessageRequest request)
public ListenableFuture<Space> findDirectMessage(FindDirectMessageRequest 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.
 With app
 authentication,
 returns the direct message space between the specified user and the calling
 Chat app.
 With user
 authentication,
 returns the direct message space between the specified user and the
 authenticated user.
 Supports the following types of
 authentication:
- App authentication with the authorization scope:
- User authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | FindDirectMessageRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Space> | |
getAttachment(GetAttachmentRequest request)
public ListenableFuture<Attachment> getAttachment(GetAttachmentRequest request)Gets the metadata of a message attachment. The attachment data is fetched using the media API. For an example, see Get metadata about a message attachment. Requires app authentication with the authorization scope:
| Parameter | |
|---|---|
| Name | Description | 
| request | GetAttachmentRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Attachment> | |
getCustomEmoji(GetCustomEmojiRequest request)
public ListenableFuture<CustomEmoji> getCustomEmoji(GetCustomEmojiRequest request)Returns details about a custom emoji. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions. Requires user authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | GetCustomEmojiRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<CustomEmoji> | |
getMembership(GetMembershipRequest request)
public ListenableFuture<Membership> getMembership(GetMembershipRequest request)Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership. Supports the following types of authentication:
- App authentication with one of the following authorization scopes:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.memberships.readonly
- https://www.googleapis.com/auth/chat.memberships
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and one of the following authorization scopes is used:
 
| Parameter | |
|---|---|
| Name | Description | 
| request | GetMembershipRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Membership> | |
getMessage(GetMessageRequest request)
public ListenableFuture<Message> getMessage(GetMessageRequest request)Returns details about a message. For an example, see Get details about a message. Supports the following types of authentication:
- App authentication with the authorization scope:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.messages.readonly
- https://www.googleapis.com/auth/chat.messagesNote: Might return a message from a blocked member or space.
 
| Parameter | |
|---|---|
| Name | Description | 
| request | GetMessageRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Message> | |
getSpace(GetSpaceRequest request)
public ListenableFuture<Space> getSpace(GetSpaceRequest request)Returns details about a space. For an example, see Get details about a space. Supports the following types of authentication:
- App authentication with one of the following authorization scopes:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.spaces.readonly
- https://www.googleapis.com/auth/chat.spaces
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and one of the following authorization scopes is used:- https://www.googleapis.com/auth/chat.admin.spaces.readonly
- https://www.googleapis.com/auth/chat.admin.spacesApp authentication has the following limitations:
 
 
- space.access_settingsis only populated when using the- chat.app.spacesscope.
- space.predefind_permission_settingsand- space.permission_settingsare only populated when using the- chat.app.spacesscope, and only for spaces the app created.
| Parameter | |
|---|---|
| Name | Description | 
| request | GetSpaceRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Space> | |
getSpaceEvent(GetSpaceEventRequest request)
public ListenableFuture<SpaceEvent> getSpaceEvent(GetSpaceEventRequest request) Returns an event from a Google Chat space. The event
 payload
 contains the most recent version of the resource that changed. For example,
 if you request an event about a new message but the message was later
 updated, the server returns the updated Message resource in the event
 payload.
 Note: The permissionSettings field is not returned in the Space
 object of the Space event data for this request.
 Requires user
 authentication
 with an authorization
 scope
 appropriate for reading the requested data:
- https://www.googleapis.com/auth/chat.spaces.readonly
- https://www.googleapis.com/auth/chat.spaces
- https://www.googleapis.com/auth/chat.messages.readonly
- https://www.googleapis.com/auth/chat.messages
- https://www.googleapis.com/auth/chat.messages.reactions.readonly
- https://www.googleapis.com/auth/chat.messages.reactions
- https://www.googleapis.com/auth/chat.memberships.readonly
- https://www.googleapis.com/auth/chat.membershipsTo get an event, the authenticated user must be a member of the space. For an example, see Get details about an event from a Google Chat space.
| Parameter | |
|---|---|
| Name | Description | 
| request | GetSpaceEventRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<SpaceEvent> | |
getSpaceNotificationSetting(GetSpaceNotificationSettingRequest request)
public ListenableFuture<SpaceNotificationSetting> getSpaceNotificationSetting(GetSpaceNotificationSettingRequest request)Gets the space notification setting. For an example, see Get the caller's space notification setting. Requires user authentication with the authorization scope:
| Parameter | |
|---|---|
| Name | Description | 
| request | GetSpaceNotificationSettingRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<SpaceNotificationSetting> | |
getSpaceReadState(GetSpaceReadStateRequest request)
public ListenableFuture<SpaceReadState> getSpaceReadState(GetSpaceReadStateRequest request)Returns details about a user's read state within a space, used to identify read and unread messages. For an example, see Get details about a user's space read state. Requires user authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | GetSpaceReadStateRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<SpaceReadState> | |
getThreadReadState(GetThreadReadStateRequest request)
public ListenableFuture<ThreadReadState> getThreadReadState(GetThreadReadStateRequest request)Returns details about a user's read state within a thread, used to identify read and unread messages. For an example, see Get details about a user's thread read state. Requires user authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | GetThreadReadStateRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<ThreadReadState> | |
listCustomEmojis(ListCustomEmojisRequest request)
public ListenableFuture<ListCustomEmojisResponse> listCustomEmojis(ListCustomEmojisRequest request)Lists custom emojis visible to the authenticated user. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions. Requires user authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | ListCustomEmojisRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<ListCustomEmojisResponse> | |
listMemberships(ListMembershipsRequest request)
public ListenableFuture<ListMembershipsResponse> listMemberships(ListMembershipsRequest request)Lists memberships in a space. For an example, see List users and Google Chat apps in a space. Listing memberships with app authentication lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with User authentication lists memberships in spaces that the authenticated user has access to. Supports the following types of authentication:
- App authentication with one of the following authorization scopes:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.memberships.readonly
- https://www.googleapis.com/auth/chat.memberships
- https://www.googleapis.com/auth/chat.import(import mode spaces only)
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and one of the following authorization scopes is used:
 
| Parameter | |
|---|---|
| Name | Description | 
| request | ListMembershipsRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<ListMembershipsResponse> | |
listMessages(ListMessagesRequest request)
public ListenableFuture<ListMessagesResponse> listMessages(ListMessagesRequest request) Lists messages in a space that the caller is a member of, including
 messages from blocked members and spaces. If you list messages from a
 space with no messages, the response is an empty object. When using a
 REST/HTTP interface, the response contains an empty JSON object, {}.
 For an example, see
 List
 messages.
 Requires user
 authentication
 with one of the following authorization
 scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | ListMessagesRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<ListMessagesResponse> | |
listReactions(ListReactionsRequest request)
public ListenableFuture<ListReactionsResponse> listReactions(ListReactionsRequest request)Lists reactions to a message. For an example, see List reactions for a message. Requires user authentication with one of the following authorization scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | ListReactionsRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<ListReactionsResponse> | |
listSpaceEvents(ListSpaceEventsRequest request)
public ListenableFuture<ListSpaceEventsResponse> listSpaceEvents(ListSpaceEventsRequest request) Lists events from a Google Chat space. For each event, the
 payload
 contains the most recent version of the Chat resource. For example, if you
 list events about new space members, the server returns Membership
 resources that contain the latest membership details. If new members were
 removed during the requested period, the event payload contains an empty
 Membership resource.
 Requires user
 authentication
 with an authorization
 scope
 appropriate for reading the requested data:
- https://www.googleapis.com/auth/chat.spaces.readonly
- https://www.googleapis.com/auth/chat.spaces
- https://www.googleapis.com/auth/chat.messages.readonly
- https://www.googleapis.com/auth/chat.messages
- https://www.googleapis.com/auth/chat.messages.reactions.readonly
- https://www.googleapis.com/auth/chat.messages.reactions
- https://www.googleapis.com/auth/chat.memberships.readonly
- https://www.googleapis.com/auth/chat.membershipsTo list events, the authenticated user must be a member of the space. For an example, see List events from a Google Chat space.
| Parameter | |
|---|---|
| Name | Description | 
| request | ListSpaceEventsRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<ListSpaceEventsResponse> | |
listSpaces(ListSpacesRequest request)
public ListenableFuture<ListSpacesResponse> listSpaces(ListSpacesRequest 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. Supports the following types of authentication:
- App authentication with the authorization scope:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.spaces.readonly
- https://www.googleapis.com/auth/chat.spacesTo list all named spaces by Google Workspace organization, use the- spaces.search()method using Workspace administrator privileges instead.
 
| Parameter | |
|---|---|
| Name | Description | 
| request | ListSpacesRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<ListSpacesResponse> | |
searchSpaces(SearchSpacesRequest request)
public ListenableFuture<SearchSpacesResponse> searchSpaces(SearchSpacesRequest request)Returns a list of spaces in a Google Workspace organization based on an administrator's search. Requires user authentication with administrator privileges and one of the following authorization scopes:
- https://www.googleapis.com/auth/chat.admin.spaces.readonly
- https://www.googleapis.com/auth/chat.admin.spacesIn the request, set- use_admin_accessto- true.
| Parameter | |
|---|---|
| Name | Description | 
| request | SearchSpacesRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<SearchSpacesResponse> | |
setUpSpace(SetUpSpaceRequest request)
public ListenableFuture<Space> setUpSpace(SetUpSpaceRequest 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 with initial
 members.
 To specify the human members to add, add memberships with the appropriate
 membership.member.name. 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.
 To specify the Google groups to add, add memberships with the
 appropriate membership.group_member.name. To add or invite a Google
 group, use groups/{group}, where {group} is the id for the group from
 the Cloud Identity Groups API. For example, you can use Cloud Identity
 Groups lookup
 API
 to retrieve the ID 123456789 for group email group@example.com, then
 you can add the group to the space by setting the
 membership.group_member.name to groups/123456789. Group email is not
 supported, and Google groups can only be added as members in named spaces.
 For a named space or group chat, if the caller blocks, or is blocked
 by some members, or doesn't have permission to add 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
 Invite or add a user or app to a
 space.
 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
 with one of the following authorization
 scopes:
| Parameter | |
|---|---|
| Name | Description | 
| request | SetUpSpaceRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Space> | |
updateMembership(UpdateMembershipRequest request)
public ListenableFuture<Membership> updateMembership(UpdateMembershipRequest request)Updates a membership. For an example, see Update a user's membership in a space. Supports the following types of authentication:
- App
authentication
with administrator
approval and the
authorization scope:- https://www.googleapis.com/auth/chat.app.memberships(only in spaces the app created)
 
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.memberships
- https://www.googleapis.com/auth/chat.import(import mode spaces only)
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and the following authorization scope is used:
 
| Parameter | |
|---|---|
| Name | Description | 
| request | UpdateMembershipRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Membership> | |
updateMessage(UpdateMessageRequest request)
public ListenableFuture<Message> updateMessage(UpdateMessageRequest 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.
 Supports the following types of
 authentication:
- App authentication with the authorization scope:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.messages
- https://www.googleapis.com/auth/chat.import(import mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app.
 
| Parameter | |
|---|---|
| Name | Description | 
| request | UpdateMessageRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Message> | |
updateSpace(UpdateSpaceRequest request)
public ListenableFuture<Space> updateSpace(UpdateSpaceRequest request) Updates a space. For an example, see
 Update a
 space.
 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.
 Supports the following types of
 authentication:
- App authentication with administrator approval and one of the following authorization scopes:
- User
authentication
with one of the following authorization scopes:- https://www.googleapis.com/auth/chat.spaces
- https://www.googleapis.com/auth/chat.import(import mode spaces only)
- User authentication grants administrator privileges when an
administrator account authenticates, use_admin_accessistrue, and the following authorization scopes is used:- https://www.googleapis.com/auth/chat.admin.spacesApp authentication has the following limitations:
 
 
- To update either space.predefined_permission_settingsorspace.permission_settings, the app must be the space creator.
- Updating the space.access_settings.audienceis not supported for app authentication.
| Parameter | |
|---|---|
| Name | Description | 
| request | UpdateSpaceRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<Space> | |
updateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest request)
public ListenableFuture<SpaceNotificationSetting> updateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest request)Updates the space notification setting. For an example, see Update the caller's space notification setting. Requires user authentication with the authorization scope:
| Parameter | |
|---|---|
| Name | Description | 
| request | UpdateSpaceNotificationSettingRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<SpaceNotificationSetting> | |
updateSpaceReadState(UpdateSpaceReadStateRequest request)
public ListenableFuture<SpaceReadState> updateSpaceReadState(UpdateSpaceReadStateRequest request)Updates a user's read state within a space, used to identify read and unread messages. For an example, see Update a user's space read state. Requires user authentication with the authorization scope:
| Parameter | |
|---|---|
| Name | Description | 
| request | UpdateSpaceReadStateRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<SpaceReadState> | |
uploadAttachment(UploadAttachmentRequest request)
public ListenableFuture<UploadAttachmentResponse> uploadAttachment(UploadAttachmentRequest request)Uploads an attachment. For an example, see Upload media as a file attachment. Requires user authentication with one of the following authorization scopes:
- https://www.googleapis.com/auth/chat.messages.create
- https://www.googleapis.com/auth/chat.messages
- https://www.googleapis.com/auth/chat.import(import mode spaces only) You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.
| Parameter | |
|---|---|
| Name | Description | 
| request | UploadAttachmentRequest | 
| Returns | |
|---|---|
| Type | Description | 
| com.google.common.util.concurrent.ListenableFuture<UploadAttachmentResponse> | |