Show / Hide Table of Contents

Class ChatServiceClient

ChatService client wrapper, for convenient use.

Inheritance
object
ChatServiceClient
ChatServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Apps.Chat.V1
Assembly: Google.Apps.Chat.V1.dll
Syntax
public abstract class ChatServiceClient
Remarks

Enables developers to build Chat apps and integrations on Google Chat Platform.

Properties

DefaultEndpoint

The default endpoint for the ChatService service, which is a host of "chat.googleapis.com" and a port of 443.

Declaration
public static string DefaultEndpoint { get; }
Property Value
Type Description
string

DefaultScopes

The default ChatService scopes.

Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type Description
IReadOnlyList<string>
Remarks

The default ChatService scopes are:

  • https://www.googleapis.com/auth/chat.admin.delete
  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships.readonly
  • https://www.googleapis.com/auth/chat.admin.spaces
  • https://www.googleapis.com/auth/chat.admin.spaces.readonly
  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.customemojis
  • https://www.googleapis.com/auth/chat.customemojis.readonly
  • https://www.googleapis.com/auth/chat.delete
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.app
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.create
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.create
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.create
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.users.readstate
  • https://www.googleapis.com/auth/chat.users.readstate.readonly
  • https://www.googleapis.com/auth/chat.users.spacesettings

GrpcClient

The underlying gRPC ChatService client

Declaration
public virtual ChatService.ChatServiceClient GrpcClient { get; }
Property Value
Type Description
ChatService.ChatServiceClient

ServiceMetadata

The service metadata associated with this client type.

Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type Description
ServiceMetadata

Methods

CompleteImportSpace(CompleteImportSpaceRequest, CallSettings)

Completes the import process 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.

Declaration
public virtual CompleteImportSpaceResponse CompleteImportSpace(CompleteImportSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CompleteImportSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CompleteImportSpaceResponse

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CompleteImportSpaceRequest request = new CompleteImportSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
};
// Make the request
CompleteImportSpaceResponse response = chatServiceClient.CompleteImportSpace(request);

CompleteImportSpaceAsync(CompleteImportSpaceRequest, CallSettings)

Completes the import process 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.

Declaration
public virtual Task<CompleteImportSpaceResponse> CompleteImportSpaceAsync(CompleteImportSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CompleteImportSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CompleteImportSpaceResponse>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CompleteImportSpaceRequest request = new CompleteImportSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
};
// Make the request
CompleteImportSpaceResponse response = await chatServiceClient.CompleteImportSpaceAsync(request);

CompleteImportSpaceAsync(CompleteImportSpaceRequest, CancellationToken)

Completes the import process 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.

Declaration
public virtual Task<CompleteImportSpaceResponse> CompleteImportSpaceAsync(CompleteImportSpaceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CompleteImportSpaceRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CompleteImportSpaceResponse>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CompleteImportSpaceRequest request = new CompleteImportSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
};
// Make the request
CompleteImportSpaceResponse response = await chatServiceClient.CompleteImportSpaceAsync(request);

Create()

Synchronously creates a ChatServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ChatServiceClientBuilder.

Declaration
public static ChatServiceClient Create()
Returns
Type Description
ChatServiceClient

The created ChatServiceClient.

CreateAsync(CancellationToken)

Asynchronously creates a ChatServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ChatServiceClientBuilder.

Declaration
public static Task<ChatServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<ChatServiceClient>

The task representing the created ChatServiceClient.

CreateCustomEmoji(CreateCustomEmojiRequest, CallSettings)

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.

Declaration
public virtual CustomEmoji CreateCustomEmoji(CreateCustomEmojiRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomEmoji

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CreateCustomEmojiRequest request = new CreateCustomEmojiRequest
{
    CustomEmoji = new CustomEmoji(),
};
// Make the request
CustomEmoji response = chatServiceClient.CreateCustomEmoji(request);

CreateCustomEmoji(CustomEmoji, CallSettings)

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.

Declaration
public virtual CustomEmoji CreateCustomEmoji(CustomEmoji customEmoji, CallSettings callSettings = null)
Parameters
Type Name Description
CustomEmoji customEmoji

Required. The custom emoji to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomEmoji

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CustomEmoji customEmoji = new CustomEmoji();
// Make the request
CustomEmoji response = chatServiceClient.CreateCustomEmoji(customEmoji);

CreateCustomEmojiAsync(CreateCustomEmojiRequest, CallSettings)

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.

Declaration
public virtual Task<CustomEmoji> CreateCustomEmojiAsync(CreateCustomEmojiRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCustomEmojiRequest request = new CreateCustomEmojiRequest
{
    CustomEmoji = new CustomEmoji(),
};
// Make the request
CustomEmoji response = await chatServiceClient.CreateCustomEmojiAsync(request);

CreateCustomEmojiAsync(CreateCustomEmojiRequest, CancellationToken)

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.

Declaration
public virtual Task<CustomEmoji> CreateCustomEmojiAsync(CreateCustomEmojiRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCustomEmojiRequest request = new CreateCustomEmojiRequest
{
    CustomEmoji = new CustomEmoji(),
};
// Make the request
CustomEmoji response = await chatServiceClient.CreateCustomEmojiAsync(request);

CreateCustomEmojiAsync(CustomEmoji, CallSettings)

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.

Declaration
public virtual Task<CustomEmoji> CreateCustomEmojiAsync(CustomEmoji customEmoji, CallSettings callSettings = null)
Parameters
Type Name Description
CustomEmoji customEmoji

Required. The custom emoji to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CustomEmoji customEmoji = new CustomEmoji();
// Make the request
CustomEmoji response = await chatServiceClient.CreateCustomEmojiAsync(customEmoji);

CreateCustomEmojiAsync(CustomEmoji, CancellationToken)

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.

Declaration
public virtual Task<CustomEmoji> CreateCustomEmojiAsync(CustomEmoji customEmoji, CancellationToken cancellationToken)
Parameters
Type Name Description
CustomEmoji customEmoji

Required. The custom emoji to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CustomEmoji customEmoji = new CustomEmoji();
// Make the request
CustomEmoji response = await chatServiceClient.CreateCustomEmojiAsync(customEmoji);

CreateMembership(CreateMembershipRequest, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Membership CreateMembership(CreateMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CreateMembershipRequest request = new CreateMembershipRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Membership = new Membership(),
    UseAdminAccess = false,
};
// Make the request
Membership response = chatServiceClient.CreateMembership(request);

CreateMembership(SpaceName, Membership, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Membership CreateMembership(SpaceName parent, Membership membership, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space for which to create the membership.

Format: spaces/{space}

Membership 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 certain authorization scopes and set specific values for certain fields:

  • When authenticating as a user, the chat.memberships authorization scope is required.

  • When authenticating as an app, the chat.app.memberships authorization scope is required. Authenticating as an app is available in Developer Preview.

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

Inviting users external to the Workspace organization that owns the space requires user authentication.

When a Chat app creates a membership relation for itself, it must authenticate as a user and use the chat.memberships.app scope, set user.type to BOT, and set user.name to users/app.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
Membership membership = new Membership();
// Make the request
Membership response = chatServiceClient.CreateMembership(parent, membership);

CreateMembership(string, Membership, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Membership CreateMembership(string parent, Membership membership, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space for which to create the membership.

Format: spaces/{space}

Membership 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 certain authorization scopes and set specific values for certain fields:

  • When authenticating as a user, the chat.memberships authorization scope is required.

  • When authenticating as an app, the chat.app.memberships authorization scope is required. Authenticating as an app is available in Developer Preview.

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

Inviting users external to the Workspace organization that owns the space requires user authentication.

When a Chat app creates a membership relation for itself, it must authenticate as a user and use the chat.memberships.app scope, set user.type to BOT, and set user.name to users/app.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
Membership membership = new Membership();
// Make the request
Membership response = chatServiceClient.CreateMembership(parent, membership);

CreateMembershipAsync(CreateMembershipRequest, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Task<Membership> CreateMembershipAsync(CreateMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateMembershipRequest request = new CreateMembershipRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Membership = new Membership(),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.CreateMembershipAsync(request);

CreateMembershipAsync(CreateMembershipRequest, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Task<Membership> CreateMembershipAsync(CreateMembershipRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateMembershipRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateMembershipRequest request = new CreateMembershipRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Membership = new Membership(),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.CreateMembershipAsync(request);

CreateMembershipAsync(SpaceName, Membership, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Task<Membership> CreateMembershipAsync(SpaceName parent, Membership membership, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space for which to create the membership.

Format: spaces/{space}

Membership 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 certain authorization scopes and set specific values for certain fields:

  • When authenticating as a user, the chat.memberships authorization scope is required.

  • When authenticating as an app, the chat.app.memberships authorization scope is required. Authenticating as an app is available in Developer Preview.

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

Inviting users external to the Workspace organization that owns the space requires user authentication.

When a Chat app creates a membership relation for itself, it must authenticate as a user and use the chat.memberships.app scope, set user.type to BOT, and set user.name to users/app.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
Membership membership = new Membership();
// Make the request
Membership response = await chatServiceClient.CreateMembershipAsync(parent, membership);

CreateMembershipAsync(SpaceName, Membership, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Task<Membership> CreateMembershipAsync(SpaceName parent, Membership membership, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space for which to create the membership.

Format: spaces/{space}

Membership 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 certain authorization scopes and set specific values for certain fields:

  • When authenticating as a user, the chat.memberships authorization scope is required.

  • When authenticating as an app, the chat.app.memberships authorization scope is required. Authenticating as an app is available in Developer Preview.

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

Inviting users external to the Workspace organization that owns the space requires user authentication.

When a Chat app creates a membership relation for itself, it must authenticate as a user and use the chat.memberships.app scope, set user.type to BOT, and set user.name to users/app.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
Membership membership = new Membership();
// Make the request
Membership response = await chatServiceClient.CreateMembershipAsync(parent, membership);

CreateMembershipAsync(string, Membership, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Task<Membership> CreateMembershipAsync(string parent, Membership membership, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space for which to create the membership.

Format: spaces/{space}

Membership 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 certain authorization scopes and set specific values for certain fields:

  • When authenticating as a user, the chat.memberships authorization scope is required.

  • When authenticating as an app, the chat.app.memberships authorization scope is required. Authenticating as an app is available in Developer Preview.

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

Inviting users external to the Workspace organization that owns the space requires user authentication.

When a Chat app creates a membership relation for itself, it must authenticate as a user and use the chat.memberships.app scope, set user.type to BOT, and set user.name to users/app.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
Membership membership = new Membership();
// Make the request
Membership response = await chatServiceClient.CreateMembershipAsync(parent, membership);

CreateMembershipAsync(string, Membership, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

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.

Declaration
public virtual Task<Membership> CreateMembershipAsync(string parent, Membership membership, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The resource name of the space for which to create the membership.

Format: spaces/{space}

Membership 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 certain authorization scopes and set specific values for certain fields:

  • When authenticating as a user, the chat.memberships authorization scope is required.

  • When authenticating as an app, the chat.app.memberships authorization scope is required. Authenticating as an app is available in Developer Preview.

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

Inviting users external to the Workspace organization that owns the space requires user authentication.

When a Chat app creates a membership relation for itself, it must authenticate as a user and use the chat.memberships.app scope, set user.type to BOT, and set user.name to users/app.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
Membership membership = new Membership();
// Make the request
Membership response = await chatServiceClient.CreateMembershipAsync(parent, membership);

CreateMessage(CreateMessageRequest, CallSettings)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Message CreateMessage(CreateMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CreateMessageRequest request = new CreateMessageRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Message = new Message(),
    RequestId = "",
    MessageReplyOption = CreateMessageRequest.Types.MessageReplyOption.Unspecified,
    MessageId = "",
};
// Make the request
Message response = chatServiceClient.CreateMessage(request);

CreateMessage(SpaceName, Message, string, CallSettings)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Message CreateMessage(SpaceName parent, Message message, string messageId, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space in which to create a message.

Format: spaces/{space}

Message message

Required. Message body.

string 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:

  • Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
Message message = new Message();
string messageId = "";
// Make the request
Message response = chatServiceClient.CreateMessage(parent, message, messageId);

CreateMessage(string, Message, string, CallSettings)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Message CreateMessage(string parent, Message message, string messageId, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space in which to create a message.

Format: spaces/{space}

Message message

Required. Message body.

string 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:

  • Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
Message message = new Message();
string messageId = "";
// Make the request
Message response = chatServiceClient.CreateMessage(parent, message, messageId);

CreateMessageAsync(CreateMessageRequest, CallSettings)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Task<Message> CreateMessageAsync(CreateMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateMessageRequest request = new CreateMessageRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Message = new Message(),
    RequestId = "",
    MessageReplyOption = CreateMessageRequest.Types.MessageReplyOption.Unspecified,
    MessageId = "",
};
// Make the request
Message response = await chatServiceClient.CreateMessageAsync(request);

CreateMessageAsync(CreateMessageRequest, CancellationToken)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Task<Message> CreateMessageAsync(CreateMessageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateMessageRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateMessageRequest request = new CreateMessageRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Message = new Message(),
    RequestId = "",
    MessageReplyOption = CreateMessageRequest.Types.MessageReplyOption.Unspecified,
    MessageId = "",
};
// Make the request
Message response = await chatServiceClient.CreateMessageAsync(request);

CreateMessageAsync(SpaceName, Message, string, CallSettings)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Task<Message> CreateMessageAsync(SpaceName parent, Message message, string messageId, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space in which to create a message.

Format: spaces/{space}

Message message

Required. Message body.

string 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:

  • Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
Message message = new Message();
string messageId = "";
// Make the request
Message response = await chatServiceClient.CreateMessageAsync(parent, message, messageId);

CreateMessageAsync(SpaceName, Message, string, CancellationToken)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Task<Message> CreateMessageAsync(SpaceName parent, Message message, string messageId, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space in which to create a message.

Format: spaces/{space}

Message message

Required. Message body.

string 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:

  • Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
Message message = new Message();
string messageId = "";
// Make the request
Message response = await chatServiceClient.CreateMessageAsync(parent, message, messageId);

CreateMessageAsync(string, Message, string, CallSettings)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Task<Message> CreateMessageAsync(string parent, Message message, string messageId, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space in which to create a message.

Format: spaces/{space}

Message message

Required. Message body.

string 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:

  • Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
Message message = new Message();
string messageId = "";
// Make the request
Message response = await chatServiceClient.CreateMessageAsync(parent, message, messageId);

CreateMessageAsync(string, Message, string, CancellationToken)

Creates a message in a Google Chat space. For an example, see Send a message.

The create() method requires either user authentication or app authentication. 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 name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual Task<Message> CreateMessageAsync(string parent, Message message, string messageId, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The resource name of the space in which to create a message.

Format: spaces/{space}

Message message

Required. Message body.

string 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:

  • Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
Message message = new Message();
string messageId = "";
// Make the request
Message response = await chatServiceClient.CreateMessageAsync(parent, message, messageId);

CreateReaction(CreateReactionRequest, CallSettings)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Reaction CreateReaction(CreateReactionRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateReactionRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Reaction

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CreateReactionRequest request = new CreateReactionRequest
{
    ParentAsMessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Reaction = new Reaction(),
};
// Make the request
Reaction response = chatServiceClient.CreateReaction(request);

CreateReaction(MessageName, Reaction, CallSettings)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Reaction CreateReaction(MessageName parent, Reaction reaction, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName parent

Required. The message where the reaction is created.

Format: spaces/{space}/messages/{message}

Reaction reaction

Required. The reaction to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Reaction

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
MessageName parent = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
Reaction reaction = new Reaction();
// Make the request
Reaction response = chatServiceClient.CreateReaction(parent, reaction);

CreateReaction(string, Reaction, CallSettings)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Reaction CreateReaction(string parent, Reaction reaction, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The message where the reaction is created.

Format: spaces/{space}/messages/{message}

Reaction reaction

Required. The reaction to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Reaction

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string parent = "spaces/[SPACE]/messages/[MESSAGE]";
Reaction reaction = new Reaction();
// Make the request
Reaction response = chatServiceClient.CreateReaction(parent, reaction);

CreateReactionAsync(CreateReactionRequest, CallSettings)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Task<Reaction> CreateReactionAsync(CreateReactionRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateReactionRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Reaction>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateReactionRequest request = new CreateReactionRequest
{
    ParentAsMessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Reaction = new Reaction(),
};
// Make the request
Reaction response = await chatServiceClient.CreateReactionAsync(request);

CreateReactionAsync(CreateReactionRequest, CancellationToken)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Task<Reaction> CreateReactionAsync(CreateReactionRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateReactionRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Reaction>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateReactionRequest request = new CreateReactionRequest
{
    ParentAsMessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Reaction = new Reaction(),
};
// Make the request
Reaction response = await chatServiceClient.CreateReactionAsync(request);

CreateReactionAsync(MessageName, Reaction, CallSettings)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Task<Reaction> CreateReactionAsync(MessageName parent, Reaction reaction, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName parent

Required. The message where the reaction is created.

Format: spaces/{space}/messages/{message}

Reaction reaction

Required. The reaction to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Reaction>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MessageName parent = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
Reaction reaction = new Reaction();
// Make the request
Reaction response = await chatServiceClient.CreateReactionAsync(parent, reaction);

CreateReactionAsync(MessageName, Reaction, CancellationToken)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Task<Reaction> CreateReactionAsync(MessageName parent, Reaction reaction, CancellationToken cancellationToken)
Parameters
Type Name Description
MessageName parent

Required. The message where the reaction is created.

Format: spaces/{space}/messages/{message}

Reaction reaction

Required. The reaction to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Reaction>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MessageName parent = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
Reaction reaction = new Reaction();
// Make the request
Reaction response = await chatServiceClient.CreateReactionAsync(parent, reaction);

CreateReactionAsync(string, Reaction, CallSettings)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Task<Reaction> CreateReactionAsync(string parent, Reaction reaction, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The message where the reaction is created.

Format: spaces/{space}/messages/{message}

Reaction reaction

Required. The reaction to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Reaction>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]/messages/[MESSAGE]";
Reaction reaction = new Reaction();
// Make the request
Reaction response = await chatServiceClient.CreateReactionAsync(parent, reaction);

CreateReactionAsync(string, Reaction, CancellationToken)

Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.

Requires user authentication.

Declaration
public virtual Task<Reaction> CreateReactionAsync(string parent, Reaction reaction, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The message where the reaction is created.

Format: spaces/{space}/messages/{message}

Reaction reaction

Required. The reaction to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Reaction>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]/messages/[MESSAGE]";
Reaction reaction = new Reaction();
// Make the request
Reaction response = await chatServiceClient.CreateReactionAsync(parent, reaction);

CreateSpace(CreateSpaceRequest, CallSettings)

Creates a space with no members. Can be used to create a named space, or a group chat in Import mode. For an example, see Create a space.

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.

Supports the following types of authentication:

  • App authentication with administrator approval in Developer Preview

  • User authentication

When authenticating as an app, the space.customer field must be set in the request.

Declaration
public virtual Space CreateSpace(CreateSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CreateSpaceRequest request = new CreateSpaceRequest
{
    Space = new Space(),
    RequestId = "",
};
// Make the request
Space response = chatServiceClient.CreateSpace(request);

CreateSpace(Space, CallSettings)

Creates a space with no members. Can be used to create a named space, or a group chat in Import mode. For an example, see Create a space.

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.

Supports the following types of authentication:

  • App authentication with administrator approval in Developer Preview

  • User authentication

When authenticating as an app, the space.customer field must be set in the request.

Declaration
public virtual Space CreateSpace(Space space, CallSettings callSettings = null)
Parameters
Type Name Description
Space space

Required. The displayName and spaceType fields must be populated. Only SpaceType.SPACE and SpaceType.GROUP_CHAT are supported. SpaceType.GROUP_CHAT can only be used if importMode is set to true.

If you receive the error message ALREADY_EXISTS, 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.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
Space space = new Space();
// Make the request
Space response = chatServiceClient.CreateSpace(space);

CreateSpaceAsync(CreateSpaceRequest, CallSettings)

Creates a space with no members. Can be used to create a named space, or a group chat in Import mode. For an example, see Create a space.

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.

Supports the following types of authentication:

  • App authentication with administrator approval in Developer Preview

  • User authentication

When authenticating as an app, the space.customer field must be set in the request.

Declaration
public virtual Task<Space> CreateSpaceAsync(CreateSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSpaceRequest request = new CreateSpaceRequest
{
    Space = new Space(),
    RequestId = "",
};
// Make the request
Space response = await chatServiceClient.CreateSpaceAsync(request);

CreateSpaceAsync(CreateSpaceRequest, CancellationToken)

Creates a space with no members. Can be used to create a named space, or a group chat in Import mode. For an example, see Create a space.

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.

Supports the following types of authentication:

  • App authentication with administrator approval in Developer Preview

  • User authentication

When authenticating as an app, the space.customer field must be set in the request.

Declaration
public virtual Task<Space> CreateSpaceAsync(CreateSpaceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateSpaceRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSpaceRequest request = new CreateSpaceRequest
{
    Space = new Space(),
    RequestId = "",
};
// Make the request
Space response = await chatServiceClient.CreateSpaceAsync(request);

CreateSpaceAsync(Space, CallSettings)

Creates a space with no members. Can be used to create a named space, or a group chat in Import mode. For an example, see Create a space.

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.

Supports the following types of authentication:

  • App authentication with administrator approval in Developer Preview

  • User authentication

When authenticating as an app, the space.customer field must be set in the request.

Declaration
public virtual Task<Space> CreateSpaceAsync(Space space, CallSettings callSettings = null)
Parameters
Type Name Description
Space space

Required. The displayName and spaceType fields must be populated. Only SpaceType.SPACE and SpaceType.GROUP_CHAT are supported. SpaceType.GROUP_CHAT can only be used if importMode is set to true.

If you receive the error message ALREADY_EXISTS, 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.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Space space = new Space();
// Make the request
Space response = await chatServiceClient.CreateSpaceAsync(space);

CreateSpaceAsync(Space, CancellationToken)

Creates a space with no members. Can be used to create a named space, or a group chat in Import mode. For an example, see Create a space.

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.

Supports the following types of authentication:

  • App authentication with administrator approval in Developer Preview

  • User authentication

When authenticating as an app, the space.customer field must be set in the request.

Declaration
public virtual Task<Space> CreateSpaceAsync(Space space, CancellationToken cancellationToken)
Parameters
Type Name Description
Space space

Required. The displayName and spaceType fields must be populated. Only SpaceType.SPACE and SpaceType.GROUP_CHAT are supported. SpaceType.GROUP_CHAT can only be used if importMode is set to true.

If you receive the error message ALREADY_EXISTS, 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.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Space space = new Space();
// Make the request
Space response = await chatServiceClient.CreateSpaceAsync(space);

DeleteCustomEmoji(CustomEmojiName, CallSettings)

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.

Declaration
public virtual void DeleteCustomEmoji(CustomEmojiName name, CallSettings callSettings = null)
Parameters
Type Name Description
CustomEmojiName name

Required. Resource name of the custom emoji to delete.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CustomEmojiName name = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]");
// Make the request
chatServiceClient.DeleteCustomEmoji(name);

DeleteCustomEmoji(DeleteCustomEmojiRequest, CallSettings)

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.

Declaration
public virtual void DeleteCustomEmoji(DeleteCustomEmojiRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
DeleteCustomEmojiRequest request = new DeleteCustomEmojiRequest
{
    CustomEmojiName = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]"),
};
// Make the request
chatServiceClient.DeleteCustomEmoji(request);

DeleteCustomEmoji(string, CallSettings)

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.

Declaration
public virtual void DeleteCustomEmoji(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the custom emoji to delete.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "customEmojis/[CUSTOM_EMOJI]";
// Make the request
chatServiceClient.DeleteCustomEmoji(name);

DeleteCustomEmojiAsync(CustomEmojiName, CallSettings)

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.

Declaration
public virtual Task DeleteCustomEmojiAsync(CustomEmojiName name, CallSettings callSettings = null)
Parameters
Type Name Description
CustomEmojiName name

Required. Resource name of the custom emoji to delete.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CustomEmojiName name = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]");
// Make the request
await chatServiceClient.DeleteCustomEmojiAsync(name);

DeleteCustomEmojiAsync(CustomEmojiName, CancellationToken)

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.

Declaration
public virtual Task DeleteCustomEmojiAsync(CustomEmojiName name, CancellationToken cancellationToken)
Parameters
Type Name Description
CustomEmojiName name

Required. Resource name of the custom emoji to delete.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CustomEmojiName name = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]");
// Make the request
await chatServiceClient.DeleteCustomEmojiAsync(name);

DeleteCustomEmojiAsync(DeleteCustomEmojiRequest, CallSettings)

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.

Declaration
public virtual Task DeleteCustomEmojiAsync(DeleteCustomEmojiRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCustomEmojiRequest request = new DeleteCustomEmojiRequest
{
    CustomEmojiName = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]"),
};
// Make the request
await chatServiceClient.DeleteCustomEmojiAsync(request);

DeleteCustomEmojiAsync(DeleteCustomEmojiRequest, CancellationToken)

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.

Declaration
public virtual Task DeleteCustomEmojiAsync(DeleteCustomEmojiRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCustomEmojiRequest request = new DeleteCustomEmojiRequest
{
    CustomEmojiName = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]"),
};
// Make the request
await chatServiceClient.DeleteCustomEmojiAsync(request);

DeleteCustomEmojiAsync(string, CallSettings)

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.

Declaration
public virtual Task DeleteCustomEmojiAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the custom emoji to delete.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "customEmojis/[CUSTOM_EMOJI]";
// Make the request
await chatServiceClient.DeleteCustomEmojiAsync(name);

DeleteCustomEmojiAsync(string, CancellationToken)

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.

Declaration
public virtual Task DeleteCustomEmojiAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Resource name of the custom emoji to delete.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "customEmojis/[CUSTOM_EMOJI]";
// Make the request
await chatServiceClient.DeleteCustomEmojiAsync(name);

DeleteMembership(DeleteMembershipRequest, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership DeleteMembership(DeleteMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
DeleteMembershipRequest request = new DeleteMembershipRequest
{
    MembershipName = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]"),
    UseAdminAccess = false,
};
// Make the request
Membership response = chatServiceClient.DeleteMembership(request);

DeleteMembership(MembershipName, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership DeleteMembership(MembershipName name, CallSettings callSettings = null)
Parameters
Type Name Description
MembershipName 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@gmail.com where example@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.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
MembershipName name = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]");
// Make the request
Membership response = chatServiceClient.DeleteMembership(name);

DeleteMembership(string, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership DeleteMembership(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string 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@gmail.com where example@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.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]/members/[MEMBER]";
// Make the request
Membership response = chatServiceClient.DeleteMembership(name);

DeleteMembershipAsync(DeleteMembershipRequest, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> DeleteMembershipAsync(DeleteMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteMembershipRequest request = new DeleteMembershipRequest
{
    MembershipName = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]"),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.DeleteMembershipAsync(request);

DeleteMembershipAsync(DeleteMembershipRequest, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> DeleteMembershipAsync(DeleteMembershipRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteMembershipRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteMembershipRequest request = new DeleteMembershipRequest
{
    MembershipName = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]"),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.DeleteMembershipAsync(request);

DeleteMembershipAsync(MembershipName, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> DeleteMembershipAsync(MembershipName name, CallSettings callSettings = null)
Parameters
Type Name Description
MembershipName 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@gmail.com where example@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.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MembershipName name = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]");
// Make the request
Membership response = await chatServiceClient.DeleteMembershipAsync(name);

DeleteMembershipAsync(MembershipName, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> DeleteMembershipAsync(MembershipName name, CancellationToken cancellationToken)
Parameters
Type Name Description
MembershipName 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@gmail.com where example@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.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MembershipName name = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]");
// Make the request
Membership response = await chatServiceClient.DeleteMembershipAsync(name);

DeleteMembershipAsync(string, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> DeleteMembershipAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string 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@gmail.com where example@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.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/members/[MEMBER]";
// Make the request
Membership response = await chatServiceClient.DeleteMembershipAsync(name);

DeleteMembershipAsync(string, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> DeleteMembershipAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string 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@gmail.com where example@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.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/members/[MEMBER]";
// Make the request
Membership response = await chatServiceClient.DeleteMembershipAsync(name);

DeleteMessage(DeleteMessageRequest, CallSettings)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual void DeleteMessage(DeleteMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
DeleteMessageRequest request = new DeleteMessageRequest
{
    MessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Force = false,
};
// Make the request
chatServiceClient.DeleteMessage(request);

DeleteMessage(MessageName, CallSettings)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual void DeleteMessage(MessageName name, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
MessageName name = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
chatServiceClient.DeleteMessage(name);

DeleteMessage(string, CallSettings)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual void DeleteMessage(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
chatServiceClient.DeleteMessage(name);

DeleteMessageAsync(DeleteMessageRequest, CallSettings)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual Task DeleteMessageAsync(DeleteMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteMessageRequest request = new DeleteMessageRequest
{
    MessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Force = false,
};
// Make the request
await chatServiceClient.DeleteMessageAsync(request);

DeleteMessageAsync(DeleteMessageRequest, CancellationToken)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual Task DeleteMessageAsync(DeleteMessageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteMessageRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteMessageRequest request = new DeleteMessageRequest
{
    MessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Force = false,
};
// Make the request
await chatServiceClient.DeleteMessageAsync(request);

DeleteMessageAsync(MessageName, CallSettings)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual Task DeleteMessageAsync(MessageName name, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MessageName name = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
await chatServiceClient.DeleteMessageAsync(name);

DeleteMessageAsync(MessageName, CancellationToken)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual Task DeleteMessageAsync(MessageName name, CancellationToken cancellationToken)
Parameters
Type Name Description
MessageName 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/workspace/chat/create-messages#name_a_created_message).

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MessageName name = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
await chatServiceClient.DeleteMessageAsync(name);

DeleteMessageAsync(string, CallSettings)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual Task DeleteMessageAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
await chatServiceClient.DeleteMessageAsync(name);

DeleteMessageAsync(string, CancellationToken)

Deletes a message. For an example, see Delete a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual Task DeleteMessageAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string 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/workspace/chat/create-messages#name_a_created_message).

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
await chatServiceClient.DeleteMessageAsync(name);

DeleteReaction(DeleteReactionRequest, CallSettings)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual void DeleteReaction(DeleteReactionRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteReactionRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
DeleteReactionRequest request = new DeleteReactionRequest
{
    ReactionName = ReactionName.FromSpaceMessageReaction("[SPACE]", "[MESSAGE]", "[REACTION]"),
};
// Make the request
chatServiceClient.DeleteReaction(request);

DeleteReaction(ReactionName, CallSettings)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual void DeleteReaction(ReactionName name, CallSettings callSettings = null)
Parameters
Type Name Description
ReactionName name

Required. Name of the reaction to delete.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ReactionName name = ReactionName.FromSpaceMessageReaction("[SPACE]", "[MESSAGE]", "[REACTION]");
// Make the request
chatServiceClient.DeleteReaction(name);

DeleteReaction(string, CallSettings)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual void DeleteReaction(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Name of the reaction to delete.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]/reactions/[REACTION]";
// Make the request
chatServiceClient.DeleteReaction(name);

DeleteReactionAsync(DeleteReactionRequest, CallSettings)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual Task DeleteReactionAsync(DeleteReactionRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteReactionRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteReactionRequest request = new DeleteReactionRequest
{
    ReactionName = ReactionName.FromSpaceMessageReaction("[SPACE]", "[MESSAGE]", "[REACTION]"),
};
// Make the request
await chatServiceClient.DeleteReactionAsync(request);

DeleteReactionAsync(DeleteReactionRequest, CancellationToken)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual Task DeleteReactionAsync(DeleteReactionRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteReactionRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteReactionRequest request = new DeleteReactionRequest
{
    ReactionName = ReactionName.FromSpaceMessageReaction("[SPACE]", "[MESSAGE]", "[REACTION]"),
};
// Make the request
await chatServiceClient.DeleteReactionAsync(request);

DeleteReactionAsync(ReactionName, CallSettings)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual Task DeleteReactionAsync(ReactionName name, CallSettings callSettings = null)
Parameters
Type Name Description
ReactionName name

Required. Name of the reaction to delete.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ReactionName name = ReactionName.FromSpaceMessageReaction("[SPACE]", "[MESSAGE]", "[REACTION]");
// Make the request
await chatServiceClient.DeleteReactionAsync(name);

DeleteReactionAsync(ReactionName, CancellationToken)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual Task DeleteReactionAsync(ReactionName name, CancellationToken cancellationToken)
Parameters
Type Name Description
ReactionName name

Required. Name of the reaction to delete.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ReactionName name = ReactionName.FromSpaceMessageReaction("[SPACE]", "[MESSAGE]", "[REACTION]");
// Make the request
await chatServiceClient.DeleteReactionAsync(name);

DeleteReactionAsync(string, CallSettings)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual Task DeleteReactionAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Name of the reaction to delete.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]/reactions/[REACTION]";
// Make the request
await chatServiceClient.DeleteReactionAsync(name);

DeleteReactionAsync(string, CancellationToken)

Deletes a reaction to a message. For an example, see Delete a reaction.

Requires user authentication.

Declaration
public virtual Task DeleteReactionAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Name of the reaction to delete.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]/reactions/[REACTION]";
// Make the request
await chatServiceClient.DeleteReactionAsync(name);

DeleteSpace(DeleteSpaceRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual void DeleteSpace(DeleteSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
DeleteSpaceRequest request = new DeleteSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
    UseAdminAccess = false,
};
// Make the request
chatServiceClient.DeleteSpace(request);

DeleteSpace(SpaceName, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual void DeleteSpace(SpaceName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName name

Required. Resource name of the space to delete.

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceName name = SpaceName.FromSpace("[SPACE]");
// Make the request
chatServiceClient.DeleteSpace(name);

DeleteSpace(string, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual void DeleteSpace(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the space to delete.

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]";
// Make the request
chatServiceClient.DeleteSpace(name);

DeleteSpaceAsync(DeleteSpaceRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task DeleteSpaceAsync(DeleteSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSpaceRequest request = new DeleteSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
    UseAdminAccess = false,
};
// Make the request
await chatServiceClient.DeleteSpaceAsync(request);

DeleteSpaceAsync(DeleteSpaceRequest, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task DeleteSpaceAsync(DeleteSpaceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteSpaceRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSpaceRequest request = new DeleteSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
    UseAdminAccess = false,
};
// Make the request
await chatServiceClient.DeleteSpaceAsync(request);

DeleteSpaceAsync(SpaceName, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task DeleteSpaceAsync(SpaceName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName name

Required. Resource name of the space to delete.

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName name = SpaceName.FromSpace("[SPACE]");
// Make the request
await chatServiceClient.DeleteSpaceAsync(name);

DeleteSpaceAsync(SpaceName, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task DeleteSpaceAsync(SpaceName name, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceName name

Required. Resource name of the space to delete.

Format: spaces/{space}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName name = SpaceName.FromSpace("[SPACE]");
// Make the request
await chatServiceClient.DeleteSpaceAsync(name);

DeleteSpaceAsync(string, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task DeleteSpaceAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the space to delete.

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]";
// Make the request
await chatServiceClient.DeleteSpaceAsync(name);

DeleteSpaceAsync(string, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task DeleteSpaceAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Resource name of the space to delete.

Format: spaces/{space}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]";
// Make the request
await chatServiceClient.DeleteSpaceAsync(name);

FindDirectMessage(FindDirectMessageRequest, CallSettings)

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

  • User authentication

Declaration
public virtual Space FindDirectMessage(FindDirectMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
FindDirectMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
FindDirectMessageRequest request = new FindDirectMessageRequest { Name = "", };
// Make the request
Space response = chatServiceClient.FindDirectMessage(request);

FindDirectMessageAsync(FindDirectMessageRequest, CallSettings)

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

  • User authentication

Declaration
public virtual Task<Space> FindDirectMessageAsync(FindDirectMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
FindDirectMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
FindDirectMessageRequest request = new FindDirectMessageRequest { Name = "", };
// Make the request
Space response = await chatServiceClient.FindDirectMessageAsync(request);

FindDirectMessageAsync(FindDirectMessageRequest, CancellationToken)

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

  • User authentication

Declaration
public virtual Task<Space> FindDirectMessageAsync(FindDirectMessageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
FindDirectMessageRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
FindDirectMessageRequest request = new FindDirectMessageRequest { Name = "", };
// Make the request
Space response = await chatServiceClient.FindDirectMessageAsync(request);

GetAttachment(AttachmentName, CallSettings)

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.

Declaration
public virtual Attachment GetAttachment(AttachmentName name, CallSettings callSettings = null)
Parameters
Type Name Description
AttachmentName name

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Attachment

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
AttachmentName name = AttachmentName.FromSpaceMessageAttachment("[SPACE]", "[MESSAGE]", "[ATTACHMENT]");
// Make the request
Attachment response = chatServiceClient.GetAttachment(name);

GetAttachment(GetAttachmentRequest, CallSettings)

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.

Declaration
public virtual Attachment GetAttachment(GetAttachmentRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetAttachmentRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Attachment

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetAttachmentRequest request = new GetAttachmentRequest
{
    AttachmentName = AttachmentName.FromSpaceMessageAttachment("[SPACE]", "[MESSAGE]", "[ATTACHMENT]"),
};
// Make the request
Attachment response = chatServiceClient.GetAttachment(request);

GetAttachment(string, CallSettings)

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.

Declaration
public virtual Attachment GetAttachment(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Attachment

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]/attachments/[ATTACHMENT]";
// Make the request
Attachment response = chatServiceClient.GetAttachment(name);

GetAttachmentAsync(AttachmentName, CallSettings)

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.

Declaration
public virtual Task<Attachment> GetAttachmentAsync(AttachmentName name, CallSettings callSettings = null)
Parameters
Type Name Description
AttachmentName name

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Attachment>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
AttachmentName name = AttachmentName.FromSpaceMessageAttachment("[SPACE]", "[MESSAGE]", "[ATTACHMENT]");
// Make the request
Attachment response = await chatServiceClient.GetAttachmentAsync(name);

GetAttachmentAsync(AttachmentName, CancellationToken)

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.

Declaration
public virtual Task<Attachment> GetAttachmentAsync(AttachmentName name, CancellationToken cancellationToken)
Parameters
Type Name Description
AttachmentName name

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Attachment>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
AttachmentName name = AttachmentName.FromSpaceMessageAttachment("[SPACE]", "[MESSAGE]", "[ATTACHMENT]");
// Make the request
Attachment response = await chatServiceClient.GetAttachmentAsync(name);

GetAttachmentAsync(GetAttachmentRequest, CallSettings)

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.

Declaration
public virtual Task<Attachment> GetAttachmentAsync(GetAttachmentRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetAttachmentRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Attachment>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetAttachmentRequest request = new GetAttachmentRequest
{
    AttachmentName = AttachmentName.FromSpaceMessageAttachment("[SPACE]", "[MESSAGE]", "[ATTACHMENT]"),
};
// Make the request
Attachment response = await chatServiceClient.GetAttachmentAsync(request);

GetAttachmentAsync(GetAttachmentRequest, CancellationToken)

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.

Declaration
public virtual Task<Attachment> GetAttachmentAsync(GetAttachmentRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetAttachmentRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Attachment>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetAttachmentRequest request = new GetAttachmentRequest
{
    AttachmentName = AttachmentName.FromSpaceMessageAttachment("[SPACE]", "[MESSAGE]", "[ATTACHMENT]"),
};
// Make the request
Attachment response = await chatServiceClient.GetAttachmentAsync(request);

GetAttachmentAsync(string, CallSettings)

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.

Declaration
public virtual Task<Attachment> GetAttachmentAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Attachment>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]/attachments/[ATTACHMENT]";
// Make the request
Attachment response = await chatServiceClient.GetAttachmentAsync(name);

GetAttachmentAsync(string, CancellationToken)

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.

Declaration
public virtual Task<Attachment> GetAttachmentAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Attachment>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]/attachments/[ATTACHMENT]";
// Make the request
Attachment response = await chatServiceClient.GetAttachmentAsync(name);

GetCustomEmoji(CustomEmojiName, CallSettings)

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.

Declaration
public virtual CustomEmoji GetCustomEmoji(CustomEmojiName name, CallSettings callSettings = null)
Parameters
Type Name Description
CustomEmojiName name

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomEmoji

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
CustomEmojiName name = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]");
// Make the request
CustomEmoji response = chatServiceClient.GetCustomEmoji(name);

GetCustomEmoji(GetCustomEmojiRequest, CallSettings)

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.

Declaration
public virtual CustomEmoji GetCustomEmoji(GetCustomEmojiRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomEmoji

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetCustomEmojiRequest request = new GetCustomEmojiRequest
{
    CustomEmojiName = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]"),
};
// Make the request
CustomEmoji response = chatServiceClient.GetCustomEmoji(request);

GetCustomEmoji(string, CallSettings)

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.

Declaration
public virtual CustomEmoji GetCustomEmoji(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomEmoji

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "customEmojis/[CUSTOM_EMOJI]";
// Make the request
CustomEmoji response = chatServiceClient.GetCustomEmoji(name);

GetCustomEmojiAsync(CustomEmojiName, CallSettings)

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.

Declaration
public virtual Task<CustomEmoji> GetCustomEmojiAsync(CustomEmojiName name, CallSettings callSettings = null)
Parameters
Type Name Description
CustomEmojiName name

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CustomEmojiName name = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]");
// Make the request
CustomEmoji response = await chatServiceClient.GetCustomEmojiAsync(name);

GetCustomEmojiAsync(CustomEmojiName, CancellationToken)

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.

Declaration
public virtual Task<CustomEmoji> GetCustomEmojiAsync(CustomEmojiName name, CancellationToken cancellationToken)
Parameters
Type Name Description
CustomEmojiName name

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
CustomEmojiName name = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]");
// Make the request
CustomEmoji response = await chatServiceClient.GetCustomEmojiAsync(name);

GetCustomEmojiAsync(GetCustomEmojiRequest, CallSettings)

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.

Declaration
public virtual Task<CustomEmoji> GetCustomEmojiAsync(GetCustomEmojiRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetCustomEmojiRequest request = new GetCustomEmojiRequest
{
    CustomEmojiName = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]"),
};
// Make the request
CustomEmoji response = await chatServiceClient.GetCustomEmojiAsync(request);

GetCustomEmojiAsync(GetCustomEmojiRequest, CancellationToken)

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.

Declaration
public virtual Task<CustomEmoji> GetCustomEmojiAsync(GetCustomEmojiRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetCustomEmojiRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetCustomEmojiRequest request = new GetCustomEmojiRequest
{
    CustomEmojiName = CustomEmojiName.FromCustomEmoji("[CUSTOM_EMOJI]"),
};
// Make the request
CustomEmoji response = await chatServiceClient.GetCustomEmojiAsync(request);

GetCustomEmojiAsync(string, CallSettings)

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.

Declaration
public virtual Task<CustomEmoji> GetCustomEmojiAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "customEmojis/[CUSTOM_EMOJI]";
// Make the request
CustomEmoji response = await chatServiceClient.GetCustomEmojiAsync(name);

GetCustomEmojiAsync(string, CancellationToken)

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.

Declaration
public virtual Task<CustomEmoji> GetCustomEmojiAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji}. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomEmoji>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "customEmojis/[CUSTOM_EMOJI]";
// Make the request
CustomEmoji response = await chatServiceClient.GetCustomEmojiAsync(name);

GetMembership(GetMembershipRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership GetMembership(GetMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetMembershipRequest request = new GetMembershipRequest
{
    MembershipName = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]"),
    UseAdminAccess = false,
};
// Make the request
Membership response = chatServiceClient.GetMembership(request);

GetMembership(MembershipName, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership GetMembership(MembershipName name, CallSettings callSettings = null)
Parameters
Type Name Description
MembershipName name

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication, you can optionally use spaces/{space}/members/app.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app

You can use the user's email as an alias for {member}. For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
MembershipName name = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]");
// Make the request
Membership response = chatServiceClient.GetMembership(name);

GetMembership(string, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership GetMembership(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication, you can optionally use spaces/{space}/members/app.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app

You can use the user's email as an alias for {member}. For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]/members/[MEMBER]";
// Make the request
Membership response = chatServiceClient.GetMembership(name);

GetMembershipAsync(GetMembershipRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> GetMembershipAsync(GetMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetMembershipRequest request = new GetMembershipRequest
{
    MembershipName = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]"),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.GetMembershipAsync(request);

GetMembershipAsync(GetMembershipRequest, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> GetMembershipAsync(GetMembershipRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetMembershipRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetMembershipRequest request = new GetMembershipRequest
{
    MembershipName = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]"),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.GetMembershipAsync(request);

GetMembershipAsync(MembershipName, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> GetMembershipAsync(MembershipName name, CallSettings callSettings = null)
Parameters
Type Name Description
MembershipName name

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication, you can optionally use spaces/{space}/members/app.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app

You can use the user's email as an alias for {member}. For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MembershipName name = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]");
// Make the request
Membership response = await chatServiceClient.GetMembershipAsync(name);

GetMembershipAsync(MembershipName, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> GetMembershipAsync(MembershipName name, CancellationToken cancellationToken)
Parameters
Type Name Description
MembershipName name

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication, you can optionally use spaces/{space}/members/app.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app

You can use the user's email as an alias for {member}. For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MembershipName name = MembershipName.FromSpaceMember("[SPACE]", "[MEMBER]");
// Make the request
Membership response = await chatServiceClient.GetMembershipAsync(name);

GetMembershipAsync(string, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> GetMembershipAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication, you can optionally use spaces/{space}/members/app.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app

You can use the user's email as an alias for {member}. For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/members/[MEMBER]";
// Make the request
Membership response = await chatServiceClient.GetMembershipAsync(name);

GetMembershipAsync(string, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> GetMembershipAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication, you can optionally use spaces/{space}/members/app.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app

You can use the user's email as an alias for {member}. For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/members/[MEMBER]";
// Make the request
Membership response = await chatServiceClient.GetMembershipAsync(name);

GetMessage(GetMessageRequest, CallSettings)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Message GetMessage(GetMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetMessageRequest request = new GetMessageRequest
{
    MessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
};
// Make the request
Message response = chatServiceClient.GetMessage(request);

GetMessage(MessageName, CallSettings)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Message GetMessage(MessageName name, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
MessageName name = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
Message response = chatServiceClient.GetMessage(name);

GetMessage(string, CallSettings)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Message GetMessage(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
Message response = chatServiceClient.GetMessage(name);

GetMessageAsync(GetMessageRequest, CallSettings)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Task<Message> GetMessageAsync(GetMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetMessageRequest request = new GetMessageRequest
{
    MessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
};
// Make the request
Message response = await chatServiceClient.GetMessageAsync(request);

GetMessageAsync(GetMessageRequest, CancellationToken)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Task<Message> GetMessageAsync(GetMessageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetMessageRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetMessageRequest request = new GetMessageRequest
{
    MessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
};
// Make the request
Message response = await chatServiceClient.GetMessageAsync(request);

GetMessageAsync(MessageName, CallSettings)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Task<Message> GetMessageAsync(MessageName name, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MessageName name = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
Message response = await chatServiceClient.GetMessageAsync(name);

GetMessageAsync(MessageName, CancellationToken)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Task<Message> GetMessageAsync(MessageName name, CancellationToken cancellationToken)
Parameters
Type Name Description
MessageName 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/workspace/chat/create-messages#name_a_created_message).

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MessageName name = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
Message response = await chatServiceClient.GetMessageAsync(name);

GetMessageAsync(string, CallSettings)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Task<Message> GetMessageAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string 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/workspace/chat/create-messages#name_a_created_message).

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
Message response = await chatServiceClient.GetMessageAsync(name);

GetMessageAsync(string, CancellationToken)

Returns details about a message. For an example, see Get details about a message.

Supports the following types of authentication:

  • App authentication

  • User authentication

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

Declaration
public virtual Task<Message> GetMessageAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string 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/workspace/chat/create-messages#name_a_created_message).

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
Message response = await chatServiceClient.GetMessageAsync(name);

GetSpace(GetSpaceRequest, CallSettings)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Space GetSpace(GetSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetSpaceRequest request = new GetSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
    UseAdminAccess = false,
};
// Make the request
Space response = chatServiceClient.GetSpace(request);

GetSpace(SpaceName, CallSettings)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Space GetSpace(SpaceName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName name

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

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceName name = SpaceName.FromSpace("[SPACE]");
// Make the request
Space response = chatServiceClient.GetSpace(name);

GetSpace(string, CallSettings)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Space GetSpace(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

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

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]";
// Make the request
Space response = chatServiceClient.GetSpace(name);

GetSpaceAsync(GetSpaceRequest, CallSettings)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> GetSpaceAsync(GetSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceRequest request = new GetSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
    UseAdminAccess = false,
};
// Make the request
Space response = await chatServiceClient.GetSpaceAsync(request);

GetSpaceAsync(GetSpaceRequest, CancellationToken)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> GetSpaceAsync(GetSpaceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetSpaceRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceRequest request = new GetSpaceRequest
{
    SpaceName = SpaceName.FromSpace("[SPACE]"),
    UseAdminAccess = false,
};
// Make the request
Space response = await chatServiceClient.GetSpaceAsync(request);

GetSpaceAsync(SpaceName, CallSettings)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> GetSpaceAsync(SpaceName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName name

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

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName name = SpaceName.FromSpace("[SPACE]");
// Make the request
Space response = await chatServiceClient.GetSpaceAsync(name);

GetSpaceAsync(SpaceName, CancellationToken)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> GetSpaceAsync(SpaceName name, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceName name

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

Format: spaces/{space}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName name = SpaceName.FromSpace("[SPACE]");
// Make the request
Space response = await chatServiceClient.GetSpaceAsync(name);

GetSpaceAsync(string, CallSettings)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> GetSpaceAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

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

Format: spaces/{space}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]";
// Make the request
Space response = await chatServiceClient.GetSpaceAsync(name);

GetSpaceAsync(string, CancellationToken)

Returns details about a space. For an example, see Get details about a space.

Supports the following types of authentication:

  • App authentication

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> GetSpaceAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

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

Format: spaces/{space}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]";
// Make the request
Space response = await chatServiceClient.GetSpaceAsync(name);

GetSpaceEvent(GetSpaceEventRequest, CallSettings)

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. To 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.

Declaration
public virtual SpaceEvent GetSpaceEvent(GetSpaceEventRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceEventRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceEvent

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetSpaceEventRequest request = new GetSpaceEventRequest
{
    SpaceEventName = SpaceEventName.FromSpaceSpaceEvent("[SPACE]", "[SPACE_EVENT]"),
};
// Make the request
SpaceEvent response = chatServiceClient.GetSpaceEvent(request);

GetSpaceEvent(SpaceEventName, CallSettings)

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. To 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.

Declaration
public virtual SpaceEvent GetSpaceEvent(SpaceEventName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceEventName name

Required. The resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceEvent

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceEventName name = SpaceEventName.FromSpaceSpaceEvent("[SPACE]", "[SPACE_EVENT]");
// Make the request
SpaceEvent response = chatServiceClient.GetSpaceEvent(name);

GetSpaceEvent(string, CallSettings)

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. To 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.

Declaration
public virtual SpaceEvent GetSpaceEvent(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceEvent

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "spaces/[SPACE]/spaceEvents/[SPACE_EVENT]";
// Make the request
SpaceEvent response = chatServiceClient.GetSpaceEvent(name);

GetSpaceEventAsync(GetSpaceEventRequest, CallSettings)

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. To 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.

Declaration
public virtual Task<SpaceEvent> GetSpaceEventAsync(GetSpaceEventRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceEventRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceEvent>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceEventRequest request = new GetSpaceEventRequest
{
    SpaceEventName = SpaceEventName.FromSpaceSpaceEvent("[SPACE]", "[SPACE_EVENT]"),
};
// Make the request
SpaceEvent response = await chatServiceClient.GetSpaceEventAsync(request);

GetSpaceEventAsync(GetSpaceEventRequest, CancellationToken)

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. To 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.

Declaration
public virtual Task<SpaceEvent> GetSpaceEventAsync(GetSpaceEventRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetSpaceEventRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceEvent>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceEventRequest request = new GetSpaceEventRequest
{
    SpaceEventName = SpaceEventName.FromSpaceSpaceEvent("[SPACE]", "[SPACE_EVENT]"),
};
// Make the request
SpaceEvent response = await chatServiceClient.GetSpaceEventAsync(request);

GetSpaceEventAsync(SpaceEventName, CallSettings)

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. To 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.

Declaration
public virtual Task<SpaceEvent> GetSpaceEventAsync(SpaceEventName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceEventName name

Required. The resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceEvent>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceEventName name = SpaceEventName.FromSpaceSpaceEvent("[SPACE]", "[SPACE_EVENT]");
// Make the request
SpaceEvent response = await chatServiceClient.GetSpaceEventAsync(name);

GetSpaceEventAsync(SpaceEventName, CancellationToken)

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. To 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.

Declaration
public virtual Task<SpaceEvent> GetSpaceEventAsync(SpaceEventName name, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceEventName name

Required. The resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceEvent>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceEventName name = SpaceEventName.FromSpaceSpaceEvent("[SPACE]", "[SPACE_EVENT]");
// Make the request
SpaceEvent response = await chatServiceClient.GetSpaceEventAsync(name);

GetSpaceEventAsync(string, CallSettings)

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. To 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.

Declaration
public virtual Task<SpaceEvent> GetSpaceEventAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceEvent>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/spaceEvents/[SPACE_EVENT]";
// Make the request
SpaceEvent response = await chatServiceClient.GetSpaceEventAsync(name);

GetSpaceEventAsync(string, CancellationToken)

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. To 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.

Declaration
public virtual Task<SpaceEvent> GetSpaceEventAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceEvent>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "spaces/[SPACE]/spaceEvents/[SPACE_EVENT]";
// Make the request
SpaceEvent response = await chatServiceClient.GetSpaceEventAsync(name);

GetSpaceNotificationSetting(GetSpaceNotificationSettingRequest, CallSettings)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual SpaceNotificationSetting GetSpaceNotificationSetting(GetSpaceNotificationSettingRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceNotificationSettingRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceNotificationSetting

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetSpaceNotificationSettingRequest request = new GetSpaceNotificationSettingRequest
{
    SpaceNotificationSettingName = SpaceNotificationSettingName.FromUserSpace("[USER]", "[SPACE]"),
};
// Make the request
SpaceNotificationSetting response = chatServiceClient.GetSpaceNotificationSetting(request);

GetSpaceNotificationSetting(SpaceNotificationSettingName, CallSettings)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual SpaceNotificationSetting GetSpaceNotificationSetting(SpaceNotificationSettingName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceNotificationSettingName name

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting, OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting, OR
  • users/123456789/spaces/{space}/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceNotificationSetting

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceNotificationSettingName name = SpaceNotificationSettingName.FromUserSpace("[USER]", "[SPACE]");
// Make the request
SpaceNotificationSetting response = chatServiceClient.GetSpaceNotificationSetting(name);

GetSpaceNotificationSetting(string, CallSettings)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual SpaceNotificationSetting GetSpaceNotificationSetting(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting, OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting, OR
  • users/123456789/spaces/{space}/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceNotificationSetting

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/spaceNotificationSetting";
// Make the request
SpaceNotificationSetting response = chatServiceClient.GetSpaceNotificationSetting(name);

GetSpaceNotificationSettingAsync(GetSpaceNotificationSettingRequest, CallSettings)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> GetSpaceNotificationSettingAsync(GetSpaceNotificationSettingRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceNotificationSettingRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceNotificationSettingRequest request = new GetSpaceNotificationSettingRequest
{
    SpaceNotificationSettingName = SpaceNotificationSettingName.FromUserSpace("[USER]", "[SPACE]"),
};
// Make the request
SpaceNotificationSetting response = await chatServiceClient.GetSpaceNotificationSettingAsync(request);

GetSpaceNotificationSettingAsync(GetSpaceNotificationSettingRequest, CancellationToken)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> GetSpaceNotificationSettingAsync(GetSpaceNotificationSettingRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetSpaceNotificationSettingRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceNotificationSettingRequest request = new GetSpaceNotificationSettingRequest
{
    SpaceNotificationSettingName = SpaceNotificationSettingName.FromUserSpace("[USER]", "[SPACE]"),
};
// Make the request
SpaceNotificationSetting response = await chatServiceClient.GetSpaceNotificationSettingAsync(request);

GetSpaceNotificationSettingAsync(SpaceNotificationSettingName, CallSettings)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> GetSpaceNotificationSettingAsync(SpaceNotificationSettingName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceNotificationSettingName name

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting, OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting, OR
  • users/123456789/spaces/{space}/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceNotificationSettingName name = SpaceNotificationSettingName.FromUserSpace("[USER]", "[SPACE]");
// Make the request
SpaceNotificationSetting response = await chatServiceClient.GetSpaceNotificationSettingAsync(name);

GetSpaceNotificationSettingAsync(SpaceNotificationSettingName, CancellationToken)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> GetSpaceNotificationSettingAsync(SpaceNotificationSettingName name, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceNotificationSettingName name

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting, OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting, OR
  • users/123456789/spaces/{space}/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.
CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceNotificationSettingName name = SpaceNotificationSettingName.FromUserSpace("[USER]", "[SPACE]");
// Make the request
SpaceNotificationSetting response = await chatServiceClient.GetSpaceNotificationSettingAsync(name);

GetSpaceNotificationSettingAsync(string, CallSettings)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> GetSpaceNotificationSettingAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting, OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting, OR
  • users/123456789/spaces/{space}/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/spaceNotificationSetting";
// Make the request
SpaceNotificationSetting response = await chatServiceClient.GetSpaceNotificationSettingAsync(name);

GetSpaceNotificationSettingAsync(string, CancellationToken)

Gets the space notification setting. For an example, see Get the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> GetSpaceNotificationSettingAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting, OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting, OR
  • users/123456789/spaces/{space}/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.
CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/spaceNotificationSetting";
// Make the request
SpaceNotificationSetting response = await chatServiceClient.GetSpaceNotificationSettingAsync(name);

GetSpaceReadState(GetSpaceReadStateRequest, CallSettings)

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.

Declaration
public virtual SpaceReadState GetSpaceReadState(GetSpaceReadStateRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceReadStateRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetSpaceReadStateRequest request = new GetSpaceReadStateRequest
{
    SpaceReadStateName = SpaceReadStateName.FromUserSpace("[USER]", "[SPACE]"),
};
// Make the request
SpaceReadState response = chatServiceClient.GetSpaceReadState(request);

GetSpaceReadState(SpaceReadStateName, CallSettings)

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.

Declaration
public virtual SpaceReadState GetSpaceReadState(SpaceReadStateName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceReadStateName name

Required. Resource name of the space read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceReadStateName name = SpaceReadStateName.FromUserSpace("[USER]", "[SPACE]");
// Make the request
SpaceReadState response = chatServiceClient.GetSpaceReadState(name);

GetSpaceReadState(string, CallSettings)

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.

Declaration
public virtual SpaceReadState GetSpaceReadState(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the space read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/spaceReadState";
// Make the request
SpaceReadState response = chatServiceClient.GetSpaceReadState(name);

GetSpaceReadStateAsync(GetSpaceReadStateRequest, CallSettings)

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.

Declaration
public virtual Task<SpaceReadState> GetSpaceReadStateAsync(GetSpaceReadStateRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetSpaceReadStateRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceReadStateRequest request = new GetSpaceReadStateRequest
{
    SpaceReadStateName = SpaceReadStateName.FromUserSpace("[USER]", "[SPACE]"),
};
// Make the request
SpaceReadState response = await chatServiceClient.GetSpaceReadStateAsync(request);

GetSpaceReadStateAsync(GetSpaceReadStateRequest, CancellationToken)

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.

Declaration
public virtual Task<SpaceReadState> GetSpaceReadStateAsync(GetSpaceReadStateRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetSpaceReadStateRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpaceReadStateRequest request = new GetSpaceReadStateRequest
{
    SpaceReadStateName = SpaceReadStateName.FromUserSpace("[USER]", "[SPACE]"),
};
// Make the request
SpaceReadState response = await chatServiceClient.GetSpaceReadStateAsync(request);

GetSpaceReadStateAsync(SpaceReadStateName, CallSettings)

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.

Declaration
public virtual Task<SpaceReadState> GetSpaceReadStateAsync(SpaceReadStateName name, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceReadStateName name

Required. Resource name of the space read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceReadStateName name = SpaceReadStateName.FromUserSpace("[USER]", "[SPACE]");
// Make the request
SpaceReadState response = await chatServiceClient.GetSpaceReadStateAsync(name);

GetSpaceReadStateAsync(SpaceReadStateName, CancellationToken)

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.

Declaration
public virtual Task<SpaceReadState> GetSpaceReadStateAsync(SpaceReadStateName name, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceReadStateName name

Required. Resource name of the space read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceReadStateName name = SpaceReadStateName.FromUserSpace("[USER]", "[SPACE]");
// Make the request
SpaceReadState response = await chatServiceClient.GetSpaceReadStateAsync(name);

GetSpaceReadStateAsync(string, CallSettings)

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.

Declaration
public virtual Task<SpaceReadState> GetSpaceReadStateAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the space read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/spaceReadState";
// Make the request
SpaceReadState response = await chatServiceClient.GetSpaceReadStateAsync(name);

GetSpaceReadStateAsync(string, CancellationToken)

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.

Declaration
public virtual Task<SpaceReadState> GetSpaceReadStateAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Resource name of the space read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/spaceReadState";
// Make the request
SpaceReadState response = await chatServiceClient.GetSpaceReadStateAsync(name);

GetThreadReadState(GetThreadReadStateRequest, CallSettings)

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.

Declaration
public virtual ThreadReadState GetThreadReadState(GetThreadReadStateRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetThreadReadStateRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ThreadReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
GetThreadReadStateRequest request = new GetThreadReadStateRequest
{
    ThreadReadStateName = ThreadReadStateName.FromUserSpaceThread("[USER]", "[SPACE]", "[THREAD]"),
};
// Make the request
ThreadReadState response = chatServiceClient.GetThreadReadState(request);

GetThreadReadState(ThreadReadStateName, CallSettings)

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.

Declaration
public virtual ThreadReadState GetThreadReadState(ThreadReadStateName name, CallSettings callSettings = null)
Parameters
Type Name Description
ThreadReadStateName name

Required. Resource name of the thread read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState.

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ThreadReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ThreadReadStateName name = ThreadReadStateName.FromUserSpaceThread("[USER]", "[SPACE]", "[THREAD]");
// Make the request
ThreadReadState response = chatServiceClient.GetThreadReadState(name);

GetThreadReadState(string, CallSettings)

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.

Declaration
public virtual ThreadReadState GetThreadReadState(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the thread read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState.

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ThreadReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/threads/[THREAD]/threadReadState";
// Make the request
ThreadReadState response = chatServiceClient.GetThreadReadState(name);

GetThreadReadStateAsync(GetThreadReadStateRequest, CallSettings)

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.

Declaration
public virtual Task<ThreadReadState> GetThreadReadStateAsync(GetThreadReadStateRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetThreadReadStateRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<ThreadReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetThreadReadStateRequest request = new GetThreadReadStateRequest
{
    ThreadReadStateName = ThreadReadStateName.FromUserSpaceThread("[USER]", "[SPACE]", "[THREAD]"),
};
// Make the request
ThreadReadState response = await chatServiceClient.GetThreadReadStateAsync(request);

GetThreadReadStateAsync(GetThreadReadStateRequest, CancellationToken)

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.

Declaration
public virtual Task<ThreadReadState> GetThreadReadStateAsync(GetThreadReadStateRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetThreadReadStateRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<ThreadReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
GetThreadReadStateRequest request = new GetThreadReadStateRequest
{
    ThreadReadStateName = ThreadReadStateName.FromUserSpaceThread("[USER]", "[SPACE]", "[THREAD]"),
};
// Make the request
ThreadReadState response = await chatServiceClient.GetThreadReadStateAsync(request);

GetThreadReadStateAsync(ThreadReadStateName, CallSettings)

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.

Declaration
public virtual Task<ThreadReadState> GetThreadReadStateAsync(ThreadReadStateName name, CallSettings callSettings = null)
Parameters
Type Name Description
ThreadReadStateName name

Required. Resource name of the thread read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState.

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<ThreadReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ThreadReadStateName name = ThreadReadStateName.FromUserSpaceThread("[USER]", "[SPACE]", "[THREAD]");
// Make the request
ThreadReadState response = await chatServiceClient.GetThreadReadStateAsync(name);

GetThreadReadStateAsync(ThreadReadStateName, CancellationToken)

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.

Declaration
public virtual Task<ThreadReadState> GetThreadReadStateAsync(ThreadReadStateName name, CancellationToken cancellationToken)
Parameters
Type Name Description
ThreadReadStateName name

Required. Resource name of the thread read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState.

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<ThreadReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ThreadReadStateName name = ThreadReadStateName.FromUserSpaceThread("[USER]", "[SPACE]", "[THREAD]");
// Make the request
ThreadReadState response = await chatServiceClient.GetThreadReadStateAsync(name);

GetThreadReadStateAsync(string, CallSettings)

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.

Declaration
public virtual Task<ThreadReadState> GetThreadReadStateAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Resource name of the thread read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState.

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<ThreadReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/threads/[THREAD]/threadReadState";
// Make the request
ThreadReadState response = await chatServiceClient.GetThreadReadStateAsync(name);

GetThreadReadStateAsync(string, CancellationToken)

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.

Declaration
public virtual Task<ThreadReadState> GetThreadReadStateAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Resource name of the thread read state to retrieve.

Only supports getting read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState.

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<ThreadReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/spaces/[SPACE]/threads/[THREAD]/threadReadState";
// Make the request
ThreadReadState response = await chatServiceClient.GetThreadReadStateAsync(name);

ListCustomEmojis(ListCustomEmojisRequest, CallSettings)

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.

Declaration
public virtual PagedEnumerable<ListCustomEmojisResponse, CustomEmoji> ListCustomEmojis(ListCustomEmojisRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListCustomEmojisRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListCustomEmojisResponse, CustomEmoji>

A pageable sequence of CustomEmoji resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ListCustomEmojisRequest request = new ListCustomEmojisRequest { Filter = "", };
// Make the request
PagedEnumerable<ListCustomEmojisResponse, CustomEmoji> response = chatServiceClient.ListCustomEmojis(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (CustomEmoji item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCustomEmojisResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomEmoji item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<CustomEmoji> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CustomEmoji item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListCustomEmojis(string, int?, CallSettings)

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.

Declaration
public virtual PagedEnumerable<ListCustomEmojisResponse, CustomEmoji> ListCustomEmojis(string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListCustomEmojisResponse, CustomEmoji>

A pageable sequence of CustomEmoji resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Make the request
PagedEnumerable<ListCustomEmojisResponse, CustomEmoji> response = chatServiceClient.ListCustomEmojis();

// Iterate over all response items, lazily performing RPCs as required
foreach (CustomEmoji item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCustomEmojisResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomEmoji item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<CustomEmoji> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CustomEmoji item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListCustomEmojisAsync(ListCustomEmojisRequest, CallSettings)

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.

Declaration
public virtual PagedAsyncEnumerable<ListCustomEmojisResponse, CustomEmoji> ListCustomEmojisAsync(ListCustomEmojisRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListCustomEmojisRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListCustomEmojisResponse, CustomEmoji>

A pageable asynchronous sequence of CustomEmoji resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ListCustomEmojisRequest request = new ListCustomEmojisRequest { Filter = "", };
// Make the request
PagedAsyncEnumerable<ListCustomEmojisResponse, CustomEmoji> response = chatServiceClient.ListCustomEmojisAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((CustomEmoji item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListCustomEmojisResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomEmoji item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<CustomEmoji> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CustomEmoji item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListCustomEmojisAsync(string, int?, CallSettings)

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.

Declaration
public virtual PagedAsyncEnumerable<ListCustomEmojisResponse, CustomEmoji> ListCustomEmojisAsync(string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListCustomEmojisResponse, CustomEmoji>

A pageable asynchronous sequence of CustomEmoji resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Make the request
PagedAsyncEnumerable<ListCustomEmojisResponse, CustomEmoji> response = chatServiceClient.ListCustomEmojisAsync();

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((CustomEmoji item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListCustomEmojisResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomEmoji item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<CustomEmoji> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CustomEmoji item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMemberships(ListMembershipsRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual PagedEnumerable<ListMembershipsResponse, Membership> ListMemberships(ListMembershipsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListMembershipsRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListMembershipsResponse, Membership>

A pageable sequence of Membership resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ListMembershipsRequest request = new ListMembershipsRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filter = "",
    ShowGroups = false,
    ShowInvited = false,
    UseAdminAccess = false,
};
// Make the request
PagedEnumerable<ListMembershipsResponse, Membership> response = chatServiceClient.ListMemberships(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Membership item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMembershipsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Membership item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Membership> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Membership item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMemberships(SpaceName, string, int?, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual PagedEnumerable<ListMembershipsResponse, Membership> ListMemberships(SpaceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space for which to fetch a membership list.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListMembershipsResponse, Membership>

A pageable sequence of Membership resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
// Make the request
PagedEnumerable<ListMembershipsResponse, Membership> response = chatServiceClient.ListMemberships(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Membership item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMembershipsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Membership item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Membership> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Membership item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMemberships(string, string, int?, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual PagedEnumerable<ListMembershipsResponse, Membership> ListMemberships(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space for which to fetch a membership list.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListMembershipsResponse, Membership>

A pageable sequence of Membership resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
// Make the request
PagedEnumerable<ListMembershipsResponse, Membership> response = chatServiceClient.ListMemberships(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Membership item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMembershipsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Membership item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Membership> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Membership item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMembershipsAsync(ListMembershipsRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual PagedAsyncEnumerable<ListMembershipsResponse, Membership> ListMembershipsAsync(ListMembershipsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListMembershipsRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListMembershipsResponse, Membership>

A pageable asynchronous sequence of Membership resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ListMembershipsRequest request = new ListMembershipsRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filter = "",
    ShowGroups = false,
    ShowInvited = false,
    UseAdminAccess = false,
};
// Make the request
PagedAsyncEnumerable<ListMembershipsResponse, Membership> response = chatServiceClient.ListMembershipsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Membership item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMembershipsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Membership item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Membership> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Membership item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMembershipsAsync(SpaceName, string, int?, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual PagedAsyncEnumerable<ListMembershipsResponse, Membership> ListMembershipsAsync(SpaceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space for which to fetch a membership list.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListMembershipsResponse, Membership>

A pageable asynchronous sequence of Membership resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
// Make the request
PagedAsyncEnumerable<ListMembershipsResponse, Membership> response = chatServiceClient.ListMembershipsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Membership item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMembershipsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Membership item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Membership> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Membership item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMembershipsAsync(string, string, int?, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual PagedAsyncEnumerable<ListMembershipsResponse, Membership> ListMembershipsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space for which to fetch a membership list.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListMembershipsResponse, Membership>

A pageable asynchronous sequence of Membership resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
// Make the request
PagedAsyncEnumerable<ListMembershipsResponse, Membership> response = chatServiceClient.ListMembershipsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Membership item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMembershipsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Membership item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Membership> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Membership item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMessages(ListMessagesRequest, CallSettings)

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.

Declaration
public virtual PagedEnumerable<ListMessagesResponse, Message> ListMessages(ListMessagesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListMessagesRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListMessagesResponse, Message>

A pageable sequence of Message resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ListMessagesRequest request = new ListMessagesRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filter = "",
    OrderBy = "",
    ShowDeleted = false,
};
// Make the request
PagedEnumerable<ListMessagesResponse, Message> response = chatServiceClient.ListMessages(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Message item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMessagesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Message item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMessages(SpaceName, string, int?, CallSettings)

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.

Declaration
public virtual PagedEnumerable<ListMessagesResponse, Message> ListMessages(SpaceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space to list messages from.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListMessagesResponse, Message>

A pageable sequence of Message resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
// Make the request
PagedEnumerable<ListMessagesResponse, Message> response = chatServiceClient.ListMessages(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Message item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMessagesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Message item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMessages(string, string, int?, CallSettings)

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.

Declaration
public virtual PagedEnumerable<ListMessagesResponse, Message> ListMessages(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space to list messages from.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListMessagesResponse, Message>

A pageable sequence of Message resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
// Make the request
PagedEnumerable<ListMessagesResponse, Message> response = chatServiceClient.ListMessages(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Message item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMessagesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Message item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMessagesAsync(ListMessagesRequest, CallSettings)

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.

Declaration
public virtual PagedAsyncEnumerable<ListMessagesResponse, Message> ListMessagesAsync(ListMessagesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListMessagesRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListMessagesResponse, Message>

A pageable asynchronous sequence of Message resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ListMessagesRequest request = new ListMessagesRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filter = "",
    OrderBy = "",
    ShowDeleted = false,
};
// Make the request
PagedAsyncEnumerable<ListMessagesResponse, Message> response = chatServiceClient.ListMessagesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Message item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMessagesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Message item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMessagesAsync(SpaceName, string, int?, CallSettings)

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.

Declaration
public virtual PagedAsyncEnumerable<ListMessagesResponse, Message> ListMessagesAsync(SpaceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. The resource name of the space to list messages from.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListMessagesResponse, Message>

A pageable asynchronous sequence of Message resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
// Make the request
PagedAsyncEnumerable<ListMessagesResponse, Message> response = chatServiceClient.ListMessagesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Message item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMessagesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Message item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListMessagesAsync(string, string, int?, CallSettings)

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.

Declaration
public virtual PagedAsyncEnumerable<ListMessagesResponse, Message> ListMessagesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the space to list messages from.

Format: spaces/{space}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListMessagesResponse, Message>

A pageable asynchronous sequence of Message resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
// Make the request
PagedAsyncEnumerable<ListMessagesResponse, Message> response = chatServiceClient.ListMessagesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Message item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMessagesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Message item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListReactions(ListReactionsRequest, CallSettings)

Lists reactions to a message. For an example, see List reactions for a message.

Requires user authentication.

Declaration
public virtual PagedEnumerable<ListReactionsResponse, Reaction> ListReactions(ListReactionsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListReactionsRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListReactionsResponse, Reaction>

A pageable sequence of Reaction resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ListReactionsRequest request = new ListReactionsRequest
{
    ParentAsMessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListReactionsResponse, Reaction> response = chatServiceClient.ListReactions(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Reaction item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListReactionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Reaction item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Reaction> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Reaction item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListReactions(MessageName, string, int?, CallSettings)

Lists reactions to a message. For an example, see List reactions for a message.

Requires user authentication.

Declaration
public virtual PagedEnumerable<ListReactionsResponse, Reaction> ListReactions(MessageName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName parent

Required. The message users reacted to.

Format: spaces/{space}/messages/{message}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListReactionsResponse, Reaction>

A pageable sequence of Reaction resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
MessageName parent = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
PagedEnumerable<ListReactionsResponse, Reaction> response = chatServiceClient.ListReactions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Reaction item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListReactionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Reaction item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Reaction> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Reaction item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListReactions(string, string, int?, CallSettings)

Lists reactions to a message. For an example, see List reactions for a message.

Requires user authentication.

Declaration
public virtual PagedEnumerable<ListReactionsResponse, Reaction> ListReactions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The message users reacted to.

Format: spaces/{space}/messages/{message}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListReactionsResponse, Reaction>

A pageable sequence of Reaction resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string parent = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
PagedEnumerable<ListReactionsResponse, Reaction> response = chatServiceClient.ListReactions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Reaction item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListReactionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Reaction item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Reaction> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Reaction item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListReactionsAsync(ListReactionsRequest, CallSettings)

Lists reactions to a message. For an example, see List reactions for a message.

Requires user authentication.

Declaration
public virtual PagedAsyncEnumerable<ListReactionsResponse, Reaction> ListReactionsAsync(ListReactionsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListReactionsRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListReactionsResponse, Reaction>

A pageable asynchronous sequence of Reaction resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ListReactionsRequest request = new ListReactionsRequest
{
    ParentAsMessageName = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListReactionsResponse, Reaction> response = chatServiceClient.ListReactionsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Reaction item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListReactionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Reaction item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Reaction> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Reaction item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListReactionsAsync(MessageName, string, int?, CallSettings)

Lists reactions to a message. For an example, see List reactions for a message.

Requires user authentication.

Declaration
public virtual PagedAsyncEnumerable<ListReactionsResponse, Reaction> ListReactionsAsync(MessageName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
MessageName parent

Required. The message users reacted to.

Format: spaces/{space}/messages/{message}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListReactionsResponse, Reaction>

A pageable asynchronous sequence of Reaction resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
MessageName parent = MessageName.FromSpaceMessage("[SPACE]", "[MESSAGE]");
// Make the request
PagedAsyncEnumerable<ListReactionsResponse, Reaction> response = chatServiceClient.ListReactionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Reaction item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListReactionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Reaction item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Reaction> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Reaction item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListReactionsAsync(string, string, int?, CallSettings)

Lists reactions to a message. For an example, see List reactions for a message.

Requires user authentication.

Declaration
public virtual PagedAsyncEnumerable<ListReactionsResponse, Reaction> ListReactionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The message users reacted to.

Format: spaces/{space}/messages/{message}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListReactionsResponse, Reaction>

A pageable asynchronous sequence of Reaction resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]/messages/[MESSAGE]";
// Make the request
PagedAsyncEnumerable<ListReactionsResponse, Reaction> response = chatServiceClient.ListReactionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Reaction item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListReactionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Reaction item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Reaction> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Reaction item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaceEvents(ListSpaceEventsRequest, CallSettings)

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. To list events, the authenticated user must be a member of the space.

For an example, see List events from a Google Chat space.

Declaration
public virtual PagedEnumerable<ListSpaceEventsResponse, SpaceEvent> ListSpaceEvents(ListSpaceEventsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListSpaceEventsRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListSpaceEventsResponse, SpaceEvent>

A pageable sequence of SpaceEvent resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ListSpaceEventsRequest request = new ListSpaceEventsRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListSpaceEventsResponse, SpaceEvent> response = chatServiceClient.ListSpaceEvents(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (SpaceEvent item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSpaceEventsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SpaceEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SpaceEvent> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SpaceEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaceEvents(SpaceName, string, string, int?, CallSettings)

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. To list events, the authenticated user must be a member of the space.

For an example, see List events from a Google Chat space.

Declaration
public virtual PagedEnumerable<ListSpaceEventsResponse, SpaceEvent> ListSpaceEvents(SpaceName parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. Resource name of the Google Chat space where the events occurred.

Format: spaces/{space}.

string filter

Required. A query filter.

You must specify at least one event type (event_type) using the has : operator. To filter by multiple event types, use the OR operator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions (google.workspace.chat.reaction.v1.created), the server also returns batch new reactions events (google.workspace.chat.reaction.v1.batchCreated). For a list of supported event types, see the SpaceEvents reference documentation.

Optionally, you can also filter by start time (start_time) and end time (end_time):

  • start_time: Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.
  • end_time: Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.

To specify a start or end time, use the equals = operator and format in RFC-3339. To filter by both start_time and end_time, use the AND operator.

For example, the following queries are valid:

start_time="2023-08-23T19:20:33+00:00" AND
end_time="2023-08-23T19:21:54+00:00"
start_time="2023-08-23T19:20:33+00:00" AND
(event_types:"google.workspace.chat.space.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created")

The following queries are invalid:

start_time="2023-08-23T19:20:33+00:00" OR
end_time="2023-08-23T19:21:54+00:00"
event_types:"google.workspace.chat.space.v1.updated" AND
event_types:"google.workspace.chat.message.v1.created"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListSpaceEventsResponse, SpaceEvent>

A pageable sequence of SpaceEvent resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
string filter = "";
// Make the request
PagedEnumerable<ListSpaceEventsResponse, SpaceEvent> response = chatServiceClient.ListSpaceEvents(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (SpaceEvent item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSpaceEventsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SpaceEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SpaceEvent> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SpaceEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaceEvents(string, string, string, int?, CallSettings)

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. To list events, the authenticated user must be a member of the space.

For an example, see List events from a Google Chat space.

Declaration
public virtual PagedEnumerable<ListSpaceEventsResponse, SpaceEvent> ListSpaceEvents(string parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Resource name of the Google Chat space where the events occurred.

Format: spaces/{space}.

string filter

Required. A query filter.

You must specify at least one event type (event_type) using the has : operator. To filter by multiple event types, use the OR operator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions (google.workspace.chat.reaction.v1.created), the server also returns batch new reactions events (google.workspace.chat.reaction.v1.batchCreated). For a list of supported event types, see the SpaceEvents reference documentation.

Optionally, you can also filter by start time (start_time) and end time (end_time):

  • start_time: Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.
  • end_time: Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.

To specify a start or end time, use the equals = operator and format in RFC-3339. To filter by both start_time and end_time, use the AND operator.

For example, the following queries are valid:

start_time="2023-08-23T19:20:33+00:00" AND
end_time="2023-08-23T19:21:54+00:00"
start_time="2023-08-23T19:20:33+00:00" AND
(event_types:"google.workspace.chat.space.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created")

The following queries are invalid:

start_time="2023-08-23T19:20:33+00:00" OR
end_time="2023-08-23T19:21:54+00:00"
event_types:"google.workspace.chat.space.v1.updated" AND
event_types:"google.workspace.chat.message.v1.created"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListSpaceEventsResponse, SpaceEvent>

A pageable sequence of SpaceEvent resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
string filter = "";
// Make the request
PagedEnumerable<ListSpaceEventsResponse, SpaceEvent> response = chatServiceClient.ListSpaceEvents(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (SpaceEvent item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSpaceEventsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SpaceEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SpaceEvent> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SpaceEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaceEventsAsync(ListSpaceEventsRequest, CallSettings)

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. To list events, the authenticated user must be a member of the space.

For an example, see List events from a Google Chat space.

Declaration
public virtual PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent> ListSpaceEventsAsync(ListSpaceEventsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListSpaceEventsRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent>

A pageable asynchronous sequence of SpaceEvent resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ListSpaceEventsRequest request = new ListSpaceEventsRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent> response = chatServiceClient.ListSpaceEventsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SpaceEvent item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSpaceEventsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SpaceEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SpaceEvent> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SpaceEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaceEventsAsync(SpaceName, string, string, int?, CallSettings)

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. To list events, the authenticated user must be a member of the space.

For an example, see List events from a Google Chat space.

Declaration
public virtual PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent> ListSpaceEventsAsync(SpaceName parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceName parent

Required. Resource name of the Google Chat space where the events occurred.

Format: spaces/{space}.

string filter

Required. A query filter.

You must specify at least one event type (event_type) using the has : operator. To filter by multiple event types, use the OR operator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions (google.workspace.chat.reaction.v1.created), the server also returns batch new reactions events (google.workspace.chat.reaction.v1.batchCreated). For a list of supported event types, see the SpaceEvents reference documentation.

Optionally, you can also filter by start time (start_time) and end time (end_time):

  • start_time: Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.
  • end_time: Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.

To specify a start or end time, use the equals = operator and format in RFC-3339. To filter by both start_time and end_time, use the AND operator.

For example, the following queries are valid:

start_time="2023-08-23T19:20:33+00:00" AND
end_time="2023-08-23T19:21:54+00:00"
start_time="2023-08-23T19:20:33+00:00" AND
(event_types:"google.workspace.chat.space.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created")

The following queries are invalid:

start_time="2023-08-23T19:20:33+00:00" OR
end_time="2023-08-23T19:21:54+00:00"
event_types:"google.workspace.chat.space.v1.updated" AND
event_types:"google.workspace.chat.message.v1.created"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent>

A pageable asynchronous sequence of SpaceEvent resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceName parent = SpaceName.FromSpace("[SPACE]");
string filter = "";
// Make the request
PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent> response = chatServiceClient.ListSpaceEventsAsync(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SpaceEvent item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSpaceEventsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SpaceEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SpaceEvent> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SpaceEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaceEventsAsync(string, string, string, int?, CallSettings)

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. To list events, the authenticated user must be a member of the space.

For an example, see List events from a Google Chat space.

Declaration
public virtual PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent> ListSpaceEventsAsync(string parent, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Resource name of the Google Chat space where the events occurred.

Format: spaces/{space}.

string filter

Required. A query filter.

You must specify at least one event type (event_type) using the has : operator. To filter by multiple event types, use the OR operator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions (google.workspace.chat.reaction.v1.created), the server also returns batch new reactions events (google.workspace.chat.reaction.v1.batchCreated). For a list of supported event types, see the SpaceEvents reference documentation.

Optionally, you can also filter by start time (start_time) and end time (end_time):

  • start_time: Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.
  • end_time: Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.

To specify a start or end time, use the equals = operator and format in RFC-3339. To filter by both start_time and end_time, use the AND operator.

For example, the following queries are valid:

start_time="2023-08-23T19:20:33+00:00" AND
end_time="2023-08-23T19:21:54+00:00"
start_time="2023-08-23T19:20:33+00:00" AND
(event_types:"google.workspace.chat.space.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created")

The following queries are invalid:

start_time="2023-08-23T19:20:33+00:00" OR
end_time="2023-08-23T19:21:54+00:00"
event_types:"google.workspace.chat.space.v1.updated" AND
event_types:"google.workspace.chat.message.v1.created"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent>

A pageable asynchronous sequence of SpaceEvent resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "spaces/[SPACE]";
string filter = "";
// Make the request
PagedAsyncEnumerable<ListSpaceEventsResponse, SpaceEvent> response = chatServiceClient.ListSpaceEventsAsync(parent, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SpaceEvent item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSpaceEventsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SpaceEvent item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SpaceEvent> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SpaceEvent item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaces(ListSpacesRequest, CallSettings)

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

  • User authentication

To list all named spaces by Google Workspace organization, use the spaces.search() method using Workspace administrator privileges instead.

Declaration
public virtual PagedEnumerable<ListSpacesResponse, Space> ListSpaces(ListSpacesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListSpacesRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListSpacesResponse, Space>

A pageable sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
ListSpacesRequest request = new ListSpacesRequest { Filter = "", };
// Make the request
PagedEnumerable<ListSpacesResponse, Space> response = chatServiceClient.ListSpaces(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Space item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSpacesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpaces(string, int?, CallSettings)

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

  • User authentication

To list all named spaces by Google Workspace organization, use the spaces.search() method using Workspace administrator privileges instead.

Declaration
public virtual PagedEnumerable<ListSpacesResponse, Space> ListSpaces(string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListSpacesResponse, Space>

A pageable sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Make the request
PagedEnumerable<ListSpacesResponse, Space> response = chatServiceClient.ListSpaces();

// Iterate over all response items, lazily performing RPCs as required
foreach (Space item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSpacesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpacesAsync(ListSpacesRequest, CallSettings)

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

  • User authentication

To list all named spaces by Google Workspace organization, use the spaces.search() method using Workspace administrator privileges instead.

Declaration
public virtual PagedAsyncEnumerable<ListSpacesResponse, Space> ListSpacesAsync(ListSpacesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListSpacesRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListSpacesResponse, Space>

A pageable asynchronous sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
ListSpacesRequest request = new ListSpacesRequest { Filter = "", };
// Make the request
PagedAsyncEnumerable<ListSpacesResponse, Space> response = chatServiceClient.ListSpacesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Space item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSpacesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSpacesAsync(string, int?, CallSettings)

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

  • User authentication

To list all named spaces by Google Workspace organization, use the spaces.search() method using Workspace administrator privileges instead.

Declaration
public virtual PagedAsyncEnumerable<ListSpacesResponse, Space> ListSpacesAsync(string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListSpacesResponse, Space>

A pageable asynchronous sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Make the request
PagedAsyncEnumerable<ListSpacesResponse, Space> response = chatServiceClient.ListSpacesAsync();

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Space item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSpacesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchSpaces(SearchSpacesRequest, CallSettings)

Returns a list of spaces in a Google Workspace organization based on an administrator's search.

Requires user authentication with administrator privileges. In the request, set use_admin_access to true.

Declaration
public virtual PagedEnumerable<SearchSpacesResponse, Space> SearchSpaces(SearchSpacesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
SearchSpacesRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<SearchSpacesResponse, Space>

A pageable sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SearchSpacesRequest request = new SearchSpacesRequest
{
    UseAdminAccess = false,
    Query = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<SearchSpacesResponse, Space> response = chatServiceClient.SearchSpaces(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Space item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchSpacesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchSpaces(string, int?, CallSettings)

Returns a list of spaces in a Google Workspace organization based on an administrator's search.

Requires user authentication with administrator privileges. In the request, set use_admin_access to true.

Declaration
public virtual PagedEnumerable<SearchSpacesResponse, Space> SearchSpaces(string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<SearchSpacesResponse, Space>

A pageable sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Make the request
PagedEnumerable<SearchSpacesResponse, Space> response = chatServiceClient.SearchSpaces();

// Iterate over all response items, lazily performing RPCs as required
foreach (Space item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchSpacesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchSpacesAsync(SearchSpacesRequest, CallSettings)

Returns a list of spaces in a Google Workspace organization based on an administrator's search.

Requires user authentication with administrator privileges. In the request, set use_admin_access to true.

Declaration
public virtual PagedAsyncEnumerable<SearchSpacesResponse, Space> SearchSpacesAsync(SearchSpacesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
SearchSpacesRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<SearchSpacesResponse, Space>

A pageable asynchronous sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SearchSpacesRequest request = new SearchSpacesRequest
{
    UseAdminAccess = false,
    Query = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<SearchSpacesResponse, Space> response = chatServiceClient.SearchSpacesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Space item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchSpacesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchSpacesAsync(string, int?, CallSettings)

Returns a list of spaces in a Google Workspace organization based on an administrator's search.

Requires user authentication with administrator privileges. In the request, set use_admin_access to true.

Declaration
public virtual PagedAsyncEnumerable<SearchSpacesResponse, Space> SearchSpacesAsync(string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<SearchSpacesResponse, Space>

A pageable asynchronous sequence of Space resources.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Make the request
PagedAsyncEnumerable<SearchSpacesResponse, Space> response = chatServiceClient.SearchSpacesAsync();

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Space item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchSpacesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Space item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SetUpSpace(SetUpSpaceRequest, CallSettings)

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.

Declaration
public virtual Space SetUpSpace(SetUpSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
SetUpSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SetUpSpaceRequest request = new SetUpSpaceRequest
{
    Space = new Space(),
    RequestId = "",
    Memberships = { new Membership(), },
};
// Make the request
Space response = chatServiceClient.SetUpSpace(request);

SetUpSpaceAsync(SetUpSpaceRequest, CallSettings)

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.

Declaration
public virtual Task<Space> SetUpSpaceAsync(SetUpSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
SetUpSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SetUpSpaceRequest request = new SetUpSpaceRequest
{
    Space = new Space(),
    RequestId = "",
    Memberships = { new Membership(), },
};
// Make the request
Space response = await chatServiceClient.SetUpSpaceAsync(request);

SetUpSpaceAsync(SetUpSpaceRequest, CancellationToken)

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.

Declaration
public virtual Task<Space> SetUpSpaceAsync(SetUpSpaceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
SetUpSpaceRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SetUpSpaceRequest request = new SetUpSpaceRequest
{
    Space = new Space(),
    RequestId = "",
    Memberships = { new Membership(), },
};
// Make the request
Space response = await chatServiceClient.SetUpSpaceAsync(request);

ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateMembership(Membership, FieldMask, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership UpdateMembership(Membership membership, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Membership membership

Required. The membership to update. Only fields specified by update_mask are updated.

FieldMask updateMask

Required. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

  • role
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
Membership membership = new Membership();
FieldMask updateMask = new FieldMask();
// Make the request
Membership response = chatServiceClient.UpdateMembership(membership, updateMask);

UpdateMembership(UpdateMembershipRequest, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Membership UpdateMembership(UpdateMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Membership

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
UpdateMembershipRequest request = new UpdateMembershipRequest
{
    Membership = new Membership(),
    UpdateMask = new FieldMask(),
    UseAdminAccess = false,
};
// Make the request
Membership response = chatServiceClient.UpdateMembership(request);

UpdateMembershipAsync(Membership, FieldMask, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> UpdateMembershipAsync(Membership membership, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Membership membership

Required. The membership to update. Only fields specified by update_mask are updated.

FieldMask updateMask

Required. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

  • role
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Membership membership = new Membership();
FieldMask updateMask = new FieldMask();
// Make the request
Membership response = await chatServiceClient.UpdateMembershipAsync(membership, updateMask);

UpdateMembershipAsync(Membership, FieldMask, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> UpdateMembershipAsync(Membership membership, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
Membership membership

Required. The membership to update. Only fields specified by update_mask are updated.

FieldMask updateMask

Required. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

  • role
CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Membership membership = new Membership();
FieldMask updateMask = new FieldMask();
// Make the request
Membership response = await chatServiceClient.UpdateMembershipAsync(membership, updateMask);

UpdateMembershipAsync(UpdateMembershipRequest, CallSettings)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> UpdateMembershipAsync(UpdateMembershipRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateMembershipRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateMembershipRequest request = new UpdateMembershipRequest
{
    Membership = new Membership(),
    UpdateMask = new FieldMask(),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.UpdateMembershipAsync(request);

UpdateMembershipAsync(UpdateMembershipRequest, CancellationToken)

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 in Developer Preview

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Membership> UpdateMembershipAsync(UpdateMembershipRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateMembershipRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Membership>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateMembershipRequest request = new UpdateMembershipRequest
{
    Membership = new Membership(),
    UpdateMask = new FieldMask(),
    UseAdminAccess = false,
};
// Make the request
Membership response = await chatServiceClient.UpdateMembershipAsync(request);

UpdateMessage(Message, FieldMask, CallSettings)

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

  • User authentication

When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual Message UpdateMessage(Message message, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Message message

Required. Message with fields updated.

FieldMask 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.)

  • cards_v2 (Requires app authentication.)

  • accessory_widgets (Requires app authentication.)

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
Message message = new Message();
FieldMask updateMask = new FieldMask();
// Make the request
Message response = chatServiceClient.UpdateMessage(message, updateMask);

UpdateMessage(UpdateMessageRequest, CallSettings)

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

  • User authentication

When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual Message UpdateMessage(UpdateMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Message

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
UpdateMessageRequest request = new UpdateMessageRequest
{
    Message = new Message(),
    UpdateMask = new FieldMask(),
    AllowMissing = false,
};
// Make the request
Message response = chatServiceClient.UpdateMessage(request);

UpdateMessageAsync(Message, FieldMask, CallSettings)

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

  • User authentication

When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual Task<Message> UpdateMessageAsync(Message message, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Message message

Required. Message with fields updated.

FieldMask 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.)

  • cards_v2 (Requires app authentication.)

  • accessory_widgets (Requires app authentication.)

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Message message = new Message();
FieldMask updateMask = new FieldMask();
// Make the request
Message response = await chatServiceClient.UpdateMessageAsync(message, updateMask);

UpdateMessageAsync(Message, FieldMask, CancellationToken)

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

  • User authentication

When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual Task<Message> UpdateMessageAsync(Message message, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
Message message

Required. Message with fields updated.

FieldMask 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.)

  • cards_v2 (Requires app authentication.)

  • accessory_widgets (Requires app authentication.)

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Message message = new Message();
FieldMask updateMask = new FieldMask();
// Make the request
Message response = await chatServiceClient.UpdateMessageAsync(message, updateMask);

UpdateMessageAsync(UpdateMessageRequest, CallSettings)

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

  • User authentication

When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual Task<Message> UpdateMessageAsync(UpdateMessageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateMessageRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateMessageRequest request = new UpdateMessageRequest
{
    Message = new Message(),
    UpdateMask = new FieldMask(),
    AllowMissing = false,
};
// Make the request
Message response = await chatServiceClient.UpdateMessageAsync(request);

UpdateMessageAsync(UpdateMessageRequest, CancellationToken)

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

  • User authentication

When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual Task<Message> UpdateMessageAsync(UpdateMessageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateMessageRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Message>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateMessageRequest request = new UpdateMessageRequest
{
    Message = new Message(),
    UpdateMask = new FieldMask(),
    AllowMissing = false,
};
// Make the request
Message response = await chatServiceClient.UpdateMessageAsync(request);

UpdateSpace(Space, FieldMask, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Space UpdateSpace(Space space, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Space 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.

FieldMask updateMask

Required. The updated field paths, comma separated if there are multiple.

You can update the following fields for a space:

space_details: Updates the space's description. Supports up to 150 characters.

display_name: Only supports updating the display name for spaces where spaceType field is SPACE. If you receive the error message ALREADY_EXISTS, try a different value. 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_type is not supported with useAdminAccess.

space_history_state: Updates space history settings by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request. space_history_state is not supported with useAdminAccess.

access_settings.audience: Updates the access setting of who can discover the space, join the space, and preview the messages in named space where spaceType field is SPACE. If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can't update this field if the space is in import mode. To learn more, see Make a space discoverable to specific users. access_settings.audience is not supported with useAdminAccess.

permission_settings: Supports changing the permission settings of a space. When updating permission settings, you can only specify permissionSettings field masks; you cannot update other field masks at the same time. permissionSettings is not supported with useAdminAccess. The supported field masks include:

  • permission_settings.manageMembersAndGroups
  • permission_settings.modifySpaceDetails
  • permission_settings.toggleHistory
  • permission_settings.useAtMentionAll
  • permission_settings.manageApps
  • permission_settings.manageWebhooks
  • permission_settings.replyMessages
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
Space space = new Space();
FieldMask updateMask = new FieldMask();
// Make the request
Space response = chatServiceClient.UpdateSpace(space, updateMask);

UpdateSpace(UpdateSpaceRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Space UpdateSpace(UpdateSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Space

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
UpdateSpaceRequest request = new UpdateSpaceRequest
{
    Space = new Space(),
    UpdateMask = new FieldMask(),
    UseAdminAccess = false,
};
// Make the request
Space response = chatServiceClient.UpdateSpace(request);

UpdateSpaceAsync(Space, FieldMask, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> UpdateSpaceAsync(Space space, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Space 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.

FieldMask updateMask

Required. The updated field paths, comma separated if there are multiple.

You can update the following fields for a space:

space_details: Updates the space's description. Supports up to 150 characters.

display_name: Only supports updating the display name for spaces where spaceType field is SPACE. If you receive the error message ALREADY_EXISTS, try a different value. 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_type is not supported with useAdminAccess.

space_history_state: Updates space history settings by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request. space_history_state is not supported with useAdminAccess.

access_settings.audience: Updates the access setting of who can discover the space, join the space, and preview the messages in named space where spaceType field is SPACE. If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can't update this field if the space is in import mode. To learn more, see Make a space discoverable to specific users. access_settings.audience is not supported with useAdminAccess.

permission_settings: Supports changing the permission settings of a space. When updating permission settings, you can only specify permissionSettings field masks; you cannot update other field masks at the same time. permissionSettings is not supported with useAdminAccess. The supported field masks include:

  • permission_settings.manageMembersAndGroups
  • permission_settings.modifySpaceDetails
  • permission_settings.toggleHistory
  • permission_settings.useAtMentionAll
  • permission_settings.manageApps
  • permission_settings.manageWebhooks
  • permission_settings.replyMessages
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Space space = new Space();
FieldMask updateMask = new FieldMask();
// Make the request
Space response = await chatServiceClient.UpdateSpaceAsync(space, updateMask);

UpdateSpaceAsync(Space, FieldMask, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> UpdateSpaceAsync(Space space, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
Space 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.

FieldMask updateMask

Required. The updated field paths, comma separated if there are multiple.

You can update the following fields for a space:

space_details: Updates the space's description. Supports up to 150 characters.

display_name: Only supports updating the display name for spaces where spaceType field is SPACE. If you receive the error message ALREADY_EXISTS, try a different value. 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_type is not supported with useAdminAccess.

space_history_state: Updates space history settings by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request. space_history_state is not supported with useAdminAccess.

access_settings.audience: Updates the access setting of who can discover the space, join the space, and preview the messages in named space where spaceType field is SPACE. If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can't update this field if the space is in import mode. To learn more, see Make a space discoverable to specific users. access_settings.audience is not supported with useAdminAccess.

permission_settings: Supports changing the permission settings of a space. When updating permission settings, you can only specify permissionSettings field masks; you cannot update other field masks at the same time. permissionSettings is not supported with useAdminAccess. The supported field masks include:

  • permission_settings.manageMembersAndGroups
  • permission_settings.modifySpaceDetails
  • permission_settings.toggleHistory
  • permission_settings.useAtMentionAll
  • permission_settings.manageApps
  • permission_settings.manageWebhooks
  • permission_settings.replyMessages
CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
Space space = new Space();
FieldMask updateMask = new FieldMask();
// Make the request
Space response = await chatServiceClient.UpdateSpaceAsync(space, updateMask);

UpdateSpaceAsync(UpdateSpaceRequest, CallSettings)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> UpdateSpaceAsync(UpdateSpaceRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateSpaceRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSpaceRequest request = new UpdateSpaceRequest
{
    Space = new Space(),
    UpdateMask = new FieldMask(),
    UseAdminAccess = false,
};
// Make the request
Space response = await chatServiceClient.UpdateSpaceAsync(request);

UpdateSpaceAsync(UpdateSpaceRequest, CancellationToken)

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

  • User authentication You can authenticate and authorize this method with administrator privileges by setting the use_admin_access field in the request.

Declaration
public virtual Task<Space> UpdateSpaceAsync(UpdateSpaceRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateSpaceRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Space>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSpaceRequest request = new UpdateSpaceRequest
{
    Space = new Space(),
    UpdateMask = new FieldMask(),
    UseAdminAccess = false,
};
// Make the request
Space response = await chatServiceClient.UpdateSpaceAsync(request);

UpdateSpaceNotificationSetting(SpaceNotificationSetting, FieldMask, CallSettings)

Updates the space notification setting. For an example, see Update the caller's space notification setting.

Requires user authentication.

Declaration
public virtual SpaceNotificationSetting UpdateSpaceNotificationSetting(SpaceNotificationSetting spaceNotificationSetting, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceNotificationSetting spaceNotificationSetting

Required. The resource name for the space notification settings must be populated in the form of users/{user}/spaces/{space}/spaceNotificationSetting. Only fields specified by update_mask are updated.

FieldMask updateMask

Required. Supported field paths:

  • notification_setting

  • mute_setting

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceNotificationSetting

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceNotificationSetting spaceNotificationSetting = new SpaceNotificationSetting();
FieldMask updateMask = new FieldMask();
// Make the request
SpaceNotificationSetting response = chatServiceClient.UpdateSpaceNotificationSetting(spaceNotificationSetting, updateMask);

UpdateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest, CallSettings)

Updates the space notification setting. For an example, see Update the caller's space notification setting.

Requires user authentication.

Declaration
public virtual SpaceNotificationSetting UpdateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateSpaceNotificationSettingRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceNotificationSetting

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
UpdateSpaceNotificationSettingRequest request = new UpdateSpaceNotificationSettingRequest
{
    SpaceNotificationSetting = new SpaceNotificationSetting(),
    UpdateMask = new FieldMask(),
};
// Make the request
SpaceNotificationSetting response = chatServiceClient.UpdateSpaceNotificationSetting(request);

UpdateSpaceNotificationSettingAsync(SpaceNotificationSetting, FieldMask, CallSettings)

Updates the space notification setting. For an example, see Update the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> UpdateSpaceNotificationSettingAsync(SpaceNotificationSetting spaceNotificationSetting, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceNotificationSetting spaceNotificationSetting

Required. The resource name for the space notification settings must be populated in the form of users/{user}/spaces/{space}/spaceNotificationSetting. Only fields specified by update_mask are updated.

FieldMask updateMask

Required. Supported field paths:

  • notification_setting

  • mute_setting

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceNotificationSetting spaceNotificationSetting = new SpaceNotificationSetting();
FieldMask updateMask = new FieldMask();
// Make the request
SpaceNotificationSetting response = await chatServiceClient.UpdateSpaceNotificationSettingAsync(spaceNotificationSetting, updateMask);

UpdateSpaceNotificationSettingAsync(SpaceNotificationSetting, FieldMask, CancellationToken)

Updates the space notification setting. For an example, see Update the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> UpdateSpaceNotificationSettingAsync(SpaceNotificationSetting spaceNotificationSetting, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceNotificationSetting spaceNotificationSetting

Required. The resource name for the space notification settings must be populated in the form of users/{user}/spaces/{space}/spaceNotificationSetting. Only fields specified by update_mask are updated.

FieldMask updateMask

Required. Supported field paths:

  • notification_setting

  • mute_setting

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceNotificationSetting spaceNotificationSetting = new SpaceNotificationSetting();
FieldMask updateMask = new FieldMask();
// Make the request
SpaceNotificationSetting response = await chatServiceClient.UpdateSpaceNotificationSettingAsync(spaceNotificationSetting, updateMask);

UpdateSpaceNotificationSettingAsync(UpdateSpaceNotificationSettingRequest, CallSettings)

Updates the space notification setting. For an example, see Update the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> UpdateSpaceNotificationSettingAsync(UpdateSpaceNotificationSettingRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateSpaceNotificationSettingRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSpaceNotificationSettingRequest request = new UpdateSpaceNotificationSettingRequest
{
    SpaceNotificationSetting = new SpaceNotificationSetting(),
    UpdateMask = new FieldMask(),
};
// Make the request
SpaceNotificationSetting response = await chatServiceClient.UpdateSpaceNotificationSettingAsync(request);

UpdateSpaceNotificationSettingAsync(UpdateSpaceNotificationSettingRequest, CancellationToken)

Updates the space notification setting. For an example, see Update the caller's space notification setting.

Requires user authentication.

Declaration
public virtual Task<SpaceNotificationSetting> UpdateSpaceNotificationSettingAsync(UpdateSpaceNotificationSettingRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateSpaceNotificationSettingRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceNotificationSetting>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSpaceNotificationSettingRequest request = new UpdateSpaceNotificationSettingRequest
{
    SpaceNotificationSetting = new SpaceNotificationSetting(),
    UpdateMask = new FieldMask(),
};
// Make the request
SpaceNotificationSetting response = await chatServiceClient.UpdateSpaceNotificationSettingAsync(request);

UpdateSpaceReadState(SpaceReadState, FieldMask, CallSettings)

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.

Declaration
public virtual SpaceReadState UpdateSpaceReadState(SpaceReadState spaceReadState, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceReadState spaceReadState

Required. The space read state and fields to update.

Only supports updating read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

FieldMask updateMask

Required. The field paths to update. Currently supported field paths:

  • last_read_time

When the last_read_time is before the latest message create time, the space appears as unread in the UI.

To mark the space as read, set last_read_time to any value later (larger) than the latest message create time. The last_read_time is coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
SpaceReadState spaceReadState = new SpaceReadState();
FieldMask updateMask = new FieldMask();
// Make the request
SpaceReadState response = chatServiceClient.UpdateSpaceReadState(spaceReadState, updateMask);

UpdateSpaceReadState(UpdateSpaceReadStateRequest, CallSettings)

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.

Declaration
public virtual SpaceReadState UpdateSpaceReadState(UpdateSpaceReadStateRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateSpaceReadStateRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SpaceReadState

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
UpdateSpaceReadStateRequest request = new UpdateSpaceReadStateRequest
{
    SpaceReadState = new SpaceReadState(),
    UpdateMask = new FieldMask(),
};
// Make the request
SpaceReadState response = chatServiceClient.UpdateSpaceReadState(request);

UpdateSpaceReadStateAsync(SpaceReadState, FieldMask, CallSettings)

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.

Declaration
public virtual Task<SpaceReadState> UpdateSpaceReadStateAsync(SpaceReadState spaceReadState, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
SpaceReadState spaceReadState

Required. The space read state and fields to update.

Only supports updating read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

FieldMask updateMask

Required. The field paths to update. Currently supported field paths:

  • last_read_time

When the last_read_time is before the latest message create time, the space appears as unread in the UI.

To mark the space as read, set last_read_time to any value later (larger) than the latest message create time. The last_read_time is coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceReadState spaceReadState = new SpaceReadState();
FieldMask updateMask = new FieldMask();
// Make the request
SpaceReadState response = await chatServiceClient.UpdateSpaceReadStateAsync(spaceReadState, updateMask);

UpdateSpaceReadStateAsync(SpaceReadState, FieldMask, CancellationToken)

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.

Declaration
public virtual Task<SpaceReadState> UpdateSpaceReadStateAsync(SpaceReadState spaceReadState, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
SpaceReadState spaceReadState

Required. The space read state and fields to update.

Only supports updating read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState.

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState.

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState.

Format: users/{user}/spaces/{space}/spaceReadState

FieldMask updateMask

Required. The field paths to update. Currently supported field paths:

  • last_read_time

When the last_read_time is before the latest message create time, the space appears as unread in the UI.

To mark the space as read, set last_read_time to any value later (larger) than the latest message create time. The last_read_time is coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
SpaceReadState spaceReadState = new SpaceReadState();
FieldMask updateMask = new FieldMask();
// Make the request
SpaceReadState response = await chatServiceClient.UpdateSpaceReadStateAsync(spaceReadState, updateMask);

UpdateSpaceReadStateAsync(UpdateSpaceReadStateRequest, CallSettings)

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.

Declaration
public virtual Task<SpaceReadState> UpdateSpaceReadStateAsync(UpdateSpaceReadStateRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateSpaceReadStateRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSpaceReadStateRequest request = new UpdateSpaceReadStateRequest
{
    SpaceReadState = new SpaceReadState(),
    UpdateMask = new FieldMask(),
};
// Make the request
SpaceReadState response = await chatServiceClient.UpdateSpaceReadStateAsync(request);

UpdateSpaceReadStateAsync(UpdateSpaceReadStateRequest, CancellationToken)

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.

Declaration
public virtual Task<SpaceReadState> UpdateSpaceReadStateAsync(UpdateSpaceReadStateRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateSpaceReadStateRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SpaceReadState>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSpaceReadStateRequest request = new UpdateSpaceReadStateRequest
{
    SpaceReadState = new SpaceReadState(),
    UpdateMask = new FieldMask(),
};
// Make the request
SpaceReadState response = await chatServiceClient.UpdateSpaceReadStateAsync(request);

UploadAttachment(UploadAttachmentRequest, CallSettings)

Uploads an attachment. For an example, see Upload media as a file attachment.

Requires user authentication.

You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.

Declaration
public virtual UploadAttachmentResponse UploadAttachment(UploadAttachmentRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UploadAttachmentRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
UploadAttachmentResponse

The RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
UploadAttachmentRequest request = new UploadAttachmentRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filename = "",
};
// Make the request
UploadAttachmentResponse response = chatServiceClient.UploadAttachment(request);

UploadAttachmentAsync(UploadAttachmentRequest, CallSettings)

Uploads an attachment. For an example, see Upload media as a file attachment.

Requires user authentication.

You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.

Declaration
public virtual Task<UploadAttachmentResponse> UploadAttachmentAsync(UploadAttachmentRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UploadAttachmentRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<UploadAttachmentResponse>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UploadAttachmentRequest request = new UploadAttachmentRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filename = "",
};
// Make the request
UploadAttachmentResponse response = await chatServiceClient.UploadAttachmentAsync(request);

UploadAttachmentAsync(UploadAttachmentRequest, CancellationToken)

Uploads an attachment. For an example, see Upload media as a file attachment.

Requires user authentication.

You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.

Declaration
public virtual Task<UploadAttachmentResponse> UploadAttachmentAsync(UploadAttachmentRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UploadAttachmentRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<UploadAttachmentResponse>

A Task containing the RPC response.

Sample code
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
UploadAttachmentRequest request = new UploadAttachmentRequest
{
    ParentAsSpaceName = SpaceName.FromSpace("[SPACE]"),
    Filename = "",
};
// Make the request
UploadAttachmentResponse response = await chatServiceClient.UploadAttachmentAsync(request);
In this article
Back to top Generated by DocFX