target.apidocs.com.google.api.services.chat.v1.HangoutsChat.Spaces.html Maven / Gradle / Ivy
HangoutsChat.Spaces (Google Chat API v1-rev20240829-2.0.0)
com.google.api.services.chat.v1
Class HangoutsChat.Spaces
- java.lang.Object
-
- com.google.api.services.chat.v1.HangoutsChat.Spaces
-
- Enclosing class:
- HangoutsChat
public class HangoutsChat.Spaces
extends Object
The "spaces" collection of methods.
-
-
Nested Class Summary
Nested Classes
Modifier and Type
Class and Description
class
HangoutsChat.Spaces.CompleteImport
class
HangoutsChat.Spaces.Create
class
HangoutsChat.Spaces.Delete
class
HangoutsChat.Spaces.FindDirectMessage
class
HangoutsChat.Spaces.Get
class
HangoutsChat.Spaces.List
class
HangoutsChat.Spaces.Members
The "members" collection of methods.
class
HangoutsChat.Spaces.Messages
The "messages" collection of methods.
class
HangoutsChat.Spaces.Patch
class
HangoutsChat.Spaces.Search
class
HangoutsChat.Spaces.Setup
class
HangoutsChat.Spaces.SpaceEvents
The "spaceEvents" collection of methods.
-
Constructor Summary
Constructors
Constructor and Description
Spaces()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
HangoutsChat.Spaces.CompleteImport
completeImport(String name,
CompleteImportSpaceRequest content)
Completes the [import process](https://developers.google.com/workspace/chat/import-data) for the
specified space and makes it visible to users.
HangoutsChat.Spaces.Create
create(Space content)
Creates a named space.
HangoutsChat.Spaces.Delete
delete(String name)
Deletes a named space.
HangoutsChat.Spaces.FindDirectMessage
findDirectMessage()
Returns the existing direct message with the specified user.
HangoutsChat.Spaces.Get
get(String name)
Returns details about a space.
HangoutsChat.Spaces.List
list()
Lists spaces the caller is a member of.
HangoutsChat.Spaces.Members
members()
An accessor for creating requests from the Members collection.
HangoutsChat.Spaces.Messages
messages()
An accessor for creating requests from the Messages collection.
HangoutsChat.Spaces.Patch
patch(String name,
Space content)
Updates a space.
HangoutsChat.Spaces.Search
search()
[Developer Preview](https://developers.google.com/workspace/preview).
HangoutsChat.Spaces.Setup
setup(SetUpSpaceRequest content)
Creates a space and adds specified users to it.
HangoutsChat.Spaces.SpaceEvents
spaceEvents()
An accessor for creating requests from the SpaceEvents collection.
-
-
Method Detail
-
completeImport
public HangoutsChat.Spaces.CompleteImport completeImport(String name,
CompleteImportSpaceRequest content)
throws IOException
Completes the [import process](https://developers.google.com/workspace/chat/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/workspace/chat/authorize-import).
Create a request for the method "spaces.completeImport".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
name
- Required. Resource name of the import mode space. Format: `spaces/{space}`
content
- the CompleteImportSpaceRequest
- Returns:
- the request
- Throws:
IOException
-
create
public HangoutsChat.Spaces.Create create(Space content)
throws IOException
Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a
space](https://developers.google.com/workspace/chat/create-spaces). 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/workspace/chat/authenticate-authorize-chat-user).
Create a request for the method "spaces.create".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
content
- the Space
- Returns:
- the request
- Throws:
IOException
-
delete
public HangoutsChat.Spaces.Delete delete(String name)
throws IOException
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/workspace/chat/delete-spaces).
Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-
authorize-chat-user) from a user who has permission to delete the space.
Create a request for the method "spaces.delete".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
name
- Required. Resource name of the space to delete. Format: `spaces/{space}`
- Returns:
- the request
- Throws:
IOException
-
findDirectMessage
public HangoutsChat.Spaces.FindDirectMessage findDirectMessage()
throws IOException
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/workspace/chat/authenticate-authorize-chat-user),
returns the direct message space between the specified user and the authenticated user. With [app
authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
returns the direct message space between the specified user and the calling Chat app. Requires
[user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-
user) or [app authentication](https://developers.google.com/workspace/chat/authenticate-
authorize-chat-app).
Create a request for the method "spaces.findDirectMessage".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Returns:
- the request
- Throws:
IOException
-
get
public HangoutsChat.Spaces.Get get(String name)
throws IOException
Returns details about a space. For an example, see [Get details about a
space](https://developers.google.com/workspace/chat/get-spaces). Requires
[authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports
[app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-
app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-
authorize-chat-user).
Create a request for the method "spaces.get".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
name
- Required. Resource name of the space, in the form `spaces/{space}`. Format: `spaces/{space}`
- Returns:
- the request
- Throws:
IOException
-
list
public HangoutsChat.Spaces.List list()
throws IOException
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/workspace/chat/list-
spaces). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-
authorize). Supports [app
authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and
[user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-
user). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't
listed until the first message is sent. To list all named spaces by Google Workspace
organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/refere
nce/rest/v1/spaces/search) method using Workspace administrator privileges instead.
Create a request for the method "spaces.list".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Returns:
- the request
- Throws:
IOException
-
patch
public HangoutsChat.Spaces.Patch patch(String name,
Space content)
throws IOException
Updates a space. For an example, see [Update a
space](https://developers.google.com/workspace/chat/update-spaces). 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/workspace/chat/authenticate-
authorize-chat-user).
Create a request for the method "spaces.patch".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
name
- Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned
ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://dev
elopers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the
space URL. For example, if the space URL is
`https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
content
- the Space
- Returns:
- the request
- Throws:
IOException
-
search
public HangoutsChat.Spaces.Search search()
throws IOException
[Developer Preview](https://developers.google.com/workspace/preview). Returns a list of spaces
based on a user's search. Requires [user
authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
The user must be an administrator for the Google Workspace organization. In the request, set
`use_admin_access` to `true`.
Create a request for the method "spaces.search".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Returns:
- the request
- Throws:
IOException
-
setup
public HangoutsChat.Spaces.Setup setup(SetUpSpaceRequest content)
throws IOException
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](https://developers.google.com/workspace/chat/set-up-spaces). 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 `[email protected]` is `123456789`, you can add the user to the space by
setting the `membership.member.name` to `users/[email protected]` 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](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID
`123456789` for group email `[email protected]`, 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](https://developers.google.com/workspace/chat/create-members). 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/workspace/chat/authenticate-authorize-chat-user).
Create a request for the method "spaces.setup".
This request holds the parameters needed by the chat server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
content
- the SetUpSpaceRequest
- Returns:
- the request
- Throws:
IOException
-
members
public HangoutsChat.Spaces.Members members()
An accessor for creating requests from the Members collection.
The typical use is:
HangoutsChat chat = new HangoutsChat(...);
HangoutsChat.Members.List request = chat.members().list(parameters ...)
- Returns:
- the resource collection
-
messages
public HangoutsChat.Spaces.Messages messages()
An accessor for creating requests from the Messages collection.
The typical use is:
HangoutsChat chat = new HangoutsChat(...);
HangoutsChat.Messages.List request = chat.messages().list(parameters ...)
- Returns:
- the resource collection
-
spaceEvents
public HangoutsChat.Spaces.SpaceEvents spaceEvents()
An accessor for creating requests from the SpaceEvents collection.
The typical use is:
HangoutsChat chat = new HangoutsChat(...);
HangoutsChat.SpaceEvents.List request = chat.spaceEvents().list(parameters ...)
- Returns:
- the resource collection
Copyright © 2011–2024 Google. All rights reserved.
© 2015 - 2024 Weber Informatics LLC | Privacy Policy