Show / Hide Table of Contents

Class SpacesResource

The "spaces" collection of methods.

Inheritance
object
SpacesResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.HangoutsChat.v1
Assembly: Google.Apis.HangoutsChat.v1.dll
Syntax
public class SpacesResource

Constructors

SpacesResource(IClientService)

Constructs a new resource.

Declaration
public SpacesResource(IClientService service)
Parameters
Type Name Description
IClientService service

Properties

Members

Gets the Members resource.

Declaration
public virtual SpacesResource.MembersResource Members { get; }
Property Value
Type Description
SpacesResource.MembersResource

Messages

Gets the Messages resource.

Declaration
public virtual SpacesResource.MessagesResource Messages { get; }
Property Value
Type Description
SpacesResource.MessagesResource

SpaceEvents

Gets the SpaceEvents resource.

Declaration
public virtual SpacesResource.SpaceEventsResource SpaceEvents { get; }
Property Value
Type Description
SpacesResource.SpaceEventsResource

Methods

CompleteImport(CompleteImportSpaceRequest, string)

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.import For more information, see Authorize Google Chat apps to import data.

Declaration
public virtual SpacesResource.CompleteImportRequest CompleteImport(CompleteImportSpaceRequest body, string name)
Parameters
Type Name Description
CompleteImportSpaceRequest body

The body of the request.

string name

Required. Resource name of the import mode space. Format: spaces/{space}

Returns
Type Description
SpacesResource.CompleteImportRequest

Create(Space)

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 in Developer Preview and one of the following authorization scopes: - https://www.googleapis.com/auth/chat.app.spaces.create - https://www.googleapis.com/auth/chat.app.spaces

  • 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. 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.
Declaration
public virtual SpacesResource.CreateRequest Create(Space body)
Parameters
Type Name Description
Space body

The body of the request.

Returns
Type Description
SpacesResource.CreateRequest

Delete(string)

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 in Developer Preview 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_access is true, and the following authorization scope is used: - https://www.googleapis.com/auth/chat.admin.delete

Declaration
public virtual SpacesResource.DeleteRequest Delete(string name)
Parameters
Type Name Description
string name

Required. Resource name of the space to delete. Format: spaces/{space}

Returns
Type Description
SpacesResource.DeleteRequest

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. 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: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.spaces.readonly - https://www.googleapis.com/auth/chat.spaces

Declaration
public virtual SpacesResource.FindDirectMessageRequest FindDirectMessage()
Returns
Type Description
SpacesResource.FindDirectMessageRequest

Get(string)

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: - https://www.googleapis.com/auth/chat.bot - https://www.googleapis.com/auth/chat.app.spaces with administrator approval - 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_access is true, 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.spaces

Declaration
public virtual SpacesResource.GetRequest Get(string name)
Parameters
Type Name Description
string name

Required. Resource name of the space, in the form spaces/{space}. Format: spaces/{space}

Returns
Type Description
SpacesResource.GetRequest

List()

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: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.spaces.readonly - https://www.googleapis.com/auth/chat.spaces To list all named spaces by Google Workspace organization, use the spaces.search() method using Workspace administrator privileges instead.

Declaration
public virtual SpacesResource.ListRequest List()
Returns
Type Description
SpacesResource.ListRequest

Patch(Space, string)

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 in Developer Preview and one of the following authorization scopes: - https://www.googleapis.com/auth/chat.app.spaces - 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_access is true, and the following authorization scopes is used: - https://www.googleapis.com/auth/chat.admin.spaces

Declaration
public virtual SpacesResource.PatchRequest Patch(Space body, string name)
Parameters
Type Name Description
Space body

The body of the request.

string name

Identifier. 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() 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.

Returns
Type Description
SpacesResource.PatchRequest

Search()

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.spaces In the request, set use_admin_access to true.

Declaration
public virtual SpacesResource.SearchRequest Search()
Returns
Type Description
SpacesResource.SearchRequest

Setup(SetUpSpaceRequest)

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: - https://www.googleapis.com/auth/chat.spaces.create - https://www.googleapis.com/auth/chat.spaces

Declaration
public virtual SpacesResource.SetupRequest Setup(SetUpSpaceRequest body)
Parameters
Type Name Description
SetUpSpaceRequest body

The body of the request.

Returns
Type Description
SpacesResource.SetupRequest
In this article
Back to top Generated by DocFX