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.ChatServiceFutureStub
Inherited Members
io.grpc.stub.AbstractFutureStub.<T>newStub(io.grpc.stub.AbstractStub.StubFactory<T>,io.grpc.Channel)
io.grpc.stub.AbstractFutureStub.<T>newStub(io.grpc.stub.AbstractStub.StubFactory<T>,io.grpc.Channel,io.grpc.CallOptions)
io.grpc.stub.AbstractStub.<T>withOption(io.grpc.CallOptions.Key<T>,T)
io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)
io.grpc.stub.AbstractStub.getCallOptions()
io.grpc.stub.AbstractStub.getChannel()
io.grpc.stub.AbstractStub.withCallCredentials(io.grpc.CallCredentials)
io.grpc.stub.AbstractStub.withChannel(io.grpc.Channel)
io.grpc.stub.AbstractStub.withCompression(java.lang.String)
io.grpc.stub.AbstractStub.withDeadline(io.grpc.Deadline)
io.grpc.stub.AbstractStub.withDeadlineAfter(java.time.Duration)
io.grpc.stub.AbstractStub.withDeadlineAfter(long,java.util.concurrent.TimeUnit)
io.grpc.stub.AbstractStub.withExecutor(java.util.concurrent.Executor)
io.grpc.stub.AbstractStub.withInterceptors(io.grpc.ClientInterceptor...)
io.grpc.stub.AbstractStub.withMaxInboundMessageSize(int)
io.grpc.stub.AbstractStub.withMaxOutboundMessageSize(int)
io.grpc.stub.AbstractStub.withOnReadyThreshold(int)
io.grpc.stub.AbstractStub.withWaitForReady()
Methods
build(Channel channel, CallOptions callOptions)
protected ChatServiceGrpc.ChatServiceFutureStub build(Channel channel, CallOptions callOptions)
| Parameters |
| Name |
Description |
channel |
io.grpc.Channel
|
callOptions |
io.grpc.CallOptions
|
Overrides
io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)
completeImportSpace(CompleteImportSpaceRequest request)
public ListenableFuture<CompleteImportSpaceResponse> completeImportSpace(CompleteImportSpaceRequest request)
createCustomEmoji(CreateCustomEmojiRequest request)
public ListenableFuture<CustomEmoji> createCustomEmoji(CreateCustomEmojiRequest request)
| 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:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Membership> |
|
createMessage(CreateMessageRequest request)
public ListenableFuture<Message> createMessage(CreateMessageRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Message> |
|
createReaction(CreateReactionRequest request)
public ListenableFuture<Reaction> createReaction(CreateReactionRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Reaction> |
|
createSection(CreateSectionRequest request)
public ListenableFuture<Section> createSection(CreateSectionRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Section> |
|
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.customer field 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_apps to 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_EXISTS when creating
a space, try a different displayName. An existing space within
the Google Workspace organization might already use this display name.
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Space> |
|
deleteCustomEmoji(DeleteCustomEmojiRequest request)
public ListenableFuture<Empty> deleteCustomEmoji(DeleteCustomEmojiRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Empty> |
|
deleteMembership(DeleteMembershipRequest request)
public ListenableFuture<Membership> deleteMembership(DeleteMembershipRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Membership> |
|
deleteMessage(DeleteMessageRequest request)
public ListenableFuture<Empty> deleteMessage(DeleteMessageRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Empty> |
|
deleteReaction(DeleteReactionRequest request)
public ListenableFuture<Empty> deleteReaction(DeleteReactionRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Empty> |
|
deleteSection(DeleteSectionRequest request)
public ListenableFuture<Empty> deleteSection(DeleteSectionRequest request)
| 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:
| 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:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Space> |
|
findGroupChats(FindGroupChatsRequest request)
public ListenableFuture<FindGroupChatsResponse> findGroupChats(FindGroupChatsRequest request)
Returns all spaces with spaceType == GROUP_CHAT, whose
human memberships contain exactly the calling user, and the users specified
in FindGroupChatsRequest.users. Only members that have joined the
conversation are supported. For an example, see Find group
chats.
If the calling user blocks, or is blocked by, some users, and no spaces
with the entire specified set of users are found, this method returns
spaces that don't include the blocked or blocking users.
The specified set of users must contain only human (non-app) memberships.
A request that contains non-human users doesn't return any spaces.
Requires user
authentication
with one of the following authorization
scopes:
getAttachment(GetAttachmentRequest request)
public ListenableFuture<Attachment> getAttachment(GetAttachmentRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Attachment> |
|
getAvailability(GetAvailabilityRequest request)
public ListenableFuture<Availability> getAvailability(GetAvailabilityRequest request)
Returns availability information for a human user in Google Chat. For
example, this can be used to check if a user is online or away, or to
retrieve their custom status message.
This method only retrieves the authenticated user's availability.
Requires user
authentication
with one of the following authorization
scopes:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Availability> |
|
getCustomEmoji(GetCustomEmojiRequest request)
public ListenableFuture<CustomEmoji> getCustomEmoji(GetCustomEmojiRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<CustomEmoji> |
|
getMembership(GetMembershipRequest request)
public ListenableFuture<Membership> getMembership(GetMembershipRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Membership> |
|
getMessage(GetMessageRequest request)
public ListenableFuture<Message> getMessage(GetMessageRequest request)
| 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:
space.access_settings is only populated when using the
chat.app.spaces scope.
space.predefind_permission_settings and space.permission_settings are
only populated when using the chat.app.spaces scope, and only for
spaces the app created.
| 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.
Supports the following types of
authentication
with an
authorization
scope
appropriate for reading the requested data:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<SpaceEvent> |
|
getSpaceNotificationSetting(GetSpaceNotificationSettingRequest request)
public ListenableFuture<SpaceNotificationSetting> getSpaceNotificationSetting(GetSpaceNotificationSettingRequest request)
getSpaceReadState(GetSpaceReadStateRequest request)
public ListenableFuture<SpaceReadState> getSpaceReadState(GetSpaceReadStateRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<SpaceReadState> |
|
getThreadReadState(GetThreadReadStateRequest request)
public ListenableFuture<ThreadReadState> getThreadReadState(GetThreadReadStateRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<ThreadReadState> |
|
listCustomEmojis(ListCustomEmojisRequest request)
public ListenableFuture<ListCustomEmojisResponse> listCustomEmojis(ListCustomEmojisRequest request)
listMemberships(ListMembershipsRequest request)
public ListenableFuture<ListMembershipsResponse> listMemberships(ListMembershipsRequest request)
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. System messages, like those
announcing new space members, aren't included. 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.
Supports the following types of
authentication:
listReactions(ListReactionsRequest request)
public ListenableFuture<ListReactionsResponse> listReactions(ListReactionsRequest request)
listSectionItems(ListSectionItemsRequest request)
public ListenableFuture<ListSectionItemsResponse> listSectionItems(ListSectionItemsRequest request)
listSections(ListSectionsRequest request)
public ListenableFuture<ListSectionsResponse> listSections(ListSectionsRequest request)
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.
Supports the following types of
authentication
with an
authorization
scope
appropriate for reading the requested data:
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:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<ListSpacesResponse> |
|
markAsActive(MarkAsActiveRequest request)
public ListenableFuture<Availability> markAsActive(MarkAsActiveRequest request)
Marks user as ACTIVE in Google Chat.
Sets the user's availability state to ACTIVE. The ACTIVE state
lasts until the specified expiration, at which point the user's state
becomes AWAY. Note that if the user is actively using Chat, the ACTIVE
state duration may extend beyond the provided expiration.
This method only updates the authenticated user's availability.
Requires user
authentication
with authorization
scope:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Availability> |
|
markAsAway(MarkAsAwayRequest request)
public ListenableFuture<Availability> markAsAway(MarkAsAwayRequest request)
Marks user as AWAY in Google Chat.
Sets the user's state to away and is not affected by the user's
activity.
This method only updates the authenticated user's availability.
Requires user
authentication
with authorization
scope:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Availability> |
|
markAsDoNotDisturb(MarkAsDoNotDisturbRequest request)
public ListenableFuture<Availability> markAsDoNotDisturb(MarkAsDoNotDisturbRequest request)
Marks user as DO_NOT_DISTURB in Google Chat.
Sets a user's availability state to DO_NOT_DISTURB until a specified
expiration time.
When in DO_NOT_DISTURB, users typically won't receive notifications.
This method only updates the authenticated user's availability.
Requires user
authentication
with authorization
scope:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Availability> |
|
moveSectionItem(MoveSectionItemRequest request)
public ListenableFuture<MoveSectionItemResponse> moveSectionItem(MoveSectionItemRequest request)
positionSection(PositionSectionRequest request)
public ListenableFuture<PositionSectionResponse> positionSection(PositionSectionRequest request)
searchSpaces(SearchSpacesRequest request)
public ListenableFuture<SearchSpacesResponse> searchSpaces(SearchSpacesRequest request)
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:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Space> |
|
updateAvailability(UpdateAvailabilityRequest request)
public ListenableFuture<Availability> updateAvailability(UpdateAvailabilityRequest request)
Updates availability information for a human user. Only the custom_status
field can be updated through this method.
This method only updates the authenticated user's availability.
Requires user
authentication
with one of the following authorization
scopes:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Availability> |
|
updateMembership(UpdateMembershipRequest request)
public ListenableFuture<Membership> updateMembership(UpdateMembershipRequest request)
| 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:
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Message> |
|
updateSection(UpdateSectionRequest request)
public ListenableFuture<Section> updateSection(UpdateSectionRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Section> |
|
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:
- To update either
space.predefined_permission_settings or
space.permission_settings, the app must be the space creator.
- Updating the
space.access_settings.audience is not supported for app
authentication.
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<Space> |
|
updateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest request)
public ListenableFuture<SpaceNotificationSetting> updateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest request)
updateSpaceReadState(UpdateSpaceReadStateRequest request)
public ListenableFuture<SpaceReadState> updateSpaceReadState(UpdateSpaceReadStateRequest request)
| Returns |
| Type |
Description |
com.google.common.util.concurrent.ListenableFuture<SpaceReadState> |
|
uploadAttachment(UploadAttachmentRequest request)
public ListenableFuture<UploadAttachmentResponse> uploadAttachment(UploadAttachmentRequest request)