Class ChatServiceClient
ChatService client wrapper, for convenient use.
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.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
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. |
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. Requires user authentication.
For example usage, see:
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. Requires user authentication.
For example usage, see:
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 |
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. Requires user authentication.
For example usage, see:
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 |
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. Requires user authentication.
For example usage, see:
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. Requires user authentication.
For example usage, see:
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. Requires user authentication.
For example usage, see:
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 |
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. Requires user authentication.
For example usage, see:
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 |
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. Requires user authentication.
For example usage, see:
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 |
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. Requires user authentication.
For example usage, see:
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 |
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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: |
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 The value for this field must meet the following requirements:
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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: |
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 The value for this field must meet the following requirements:
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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: |
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 The value for this field must meet the following requirements:
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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: |
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 The value for this field must meet the following requirements:
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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: |
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 The value for this field must meet the following requirements:
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 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
).
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
).
The maximum message size, including the message contents, is 32,000 bytes.
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: |
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 The value for this field must meet the following requirements:
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. Only unicode emojis are supported. 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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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. Only unicode emojis are supported. 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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Spaces grouped by topics aren't supported. 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.
If you're a member of the Developer Preview
program, you can create a
group chat in import mode using spaceType.GROUP_CHAT
.
Requires user authentication.
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. Spaces grouped by topics aren't supported. 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.
If you're a member of the Developer Preview
program, you can create a
group chat in import mode using spaceType.GROUP_CHAT
.
Requires user authentication.
Declaration
public virtual Space CreateSpace(Space space, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Space | space | Required. The If you receive the error message If you're a member of the Developer Preview
program,
The 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)
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. Spaces grouped by topics aren't supported. 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.
If you're a member of the Developer Preview
program, you can create a
group chat in import mode using spaceType.GROUP_CHAT
.
Requires user authentication.
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. Spaces grouped by topics aren't supported. 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.
If you're a member of the Developer Preview
program, you can create a
group chat in import mode using spaceType.GROUP_CHAT
.
Requires user authentication.
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. Spaces grouped by topics aren't supported. 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.
If you're a member of the Developer Preview
program, you can create a
group chat in import mode using spaceType.GROUP_CHAT
.
Requires user authentication.
Declaration
public virtual Task<Space> CreateSpaceAsync(Space space, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Space | space | Required. The If you receive the error message If you're a member of the Developer Preview
program,
The 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)
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. Spaces grouped by topics aren't supported. 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.
If you're a member of the Developer Preview
program, you can create a
group chat in import mode using spaceType.GROUP_CHAT
.
Requires user authentication.
Declaration
public virtual Task<Space> CreateSpaceAsync(Space space, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Space | space | Required. The If you receive the error message If you're a member of the Developer Preview
program,
The 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)
Space space = new Space();
// Make the request
Space response = await chatServiceClient.CreateSpaceAsync(space);
DeleteMembership(DeleteMembershipRequest, CallSettings)
Deletes a membership. For an example, see Remove a user or a Google Chat app from a space.
Requires user authentication.
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.
Requires user authentication.
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 When deleting an app membership, requires the Format: |
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.
Requires user authentication.
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 When deleting an app membership, requires the Format: |
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.
Requires user authentication.
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.
Requires user authentication.
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.
Requires user authentication.
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 When deleting an app membership, requires the Format: |
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.
Requires user authentication.
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 When deleting an app membership, requires the Format: |
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.
Requires user authentication.
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 When deleting an app membership, requires the Format: |
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.
Requires user authentication.
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 When deleting an app membership, requires the Format: |
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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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. Only unicode emojis are supported. 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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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. Only unicode emojis are supported. 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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Only unicode emojis are supported. 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: |
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. Requires user authentication from a user who has permission to delete the space.
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. Requires user authentication from a user who has permission to delete the space.
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: |
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. Requires user authentication from a user who has permission to delete the space.
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: |
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. Requires user authentication from a user who has permission to delete the space.
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. Requires user authentication from a user who has permission to delete the space.
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. Requires user authentication from a user who has permission to delete the space.
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: |
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. Requires user authentication from a user who has permission to delete the space.
Declaration
public virtual Task DeleteSpaceAsync(SpaceName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
SpaceName | name | Required. Resource name of the space to delete. Format: |
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. Requires user authentication from a user who has permission to delete the space.
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: |
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. Requires user authentication from a user who has permission to delete the space.
Declaration
public virtual Task DeleteSpaceAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. Resource name of the space to delete. Format: |
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 user authentication, returns the direct message space between the specified user and the authenticated user.
With app authentication, returns the direct message space between the specified user and the calling Chat app.
Requires user authentication or app 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 user authentication, returns the direct message space between the specified user and the authenticated user.
With app authentication, returns the direct message space between the specified user and the calling Chat app.
Requires user authentication or app 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 user authentication, returns the direct message space between the specified user and the authenticated user.
With app authentication, returns the direct message space between the specified user and the calling Chat app.
Requires user authentication or app 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
|
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
|
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
|
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
|
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
|
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
|
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);
GetMembership(GetMembershipRequest, CallSettings)
Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: When authenticated as a
user,
you can use the user's email as an alias for |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: When authenticated as a
user,
you can use the user's email as an alias for |
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.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: When authenticated as a
user,
you can use the user's email as an alias for |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: When authenticated as a
user,
you can use the user's email as an alias for |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: When authenticated as a
user,
you can use the user's email as an alias for |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: When authenticated as a
user,
you can use the user's email as an alias for |
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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and 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: If you've set a custom ID for your message, you can use the value from the
|
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.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: |
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.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: |
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.
Requires authentication. Supports app authentication and user authentication.
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 Format: |
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: |
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: |
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: |
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: |
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: |
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: |
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);
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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);
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.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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.
Requires authentication. Supports app authentication and user authentication.
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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.
Requires authentication. Supports app authentication and user authentication.
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.
Requires authentication. Supports app authentication and user authentication.
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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.
Requires authentication. Supports app authentication and user authentication.
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | filter | Required. A query filter. You must specify at least one event type ( Optionally, you can also filter by start time (
To specify a start or end time, use the equals For example, the following queries are valid:
The following queries are invalid:
Invalid queries are rejected by the server with an |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | filter | Required. A query filter. You must specify at least one event type ( Optionally, you can also filter by start time (
To specify a start or end time, use the equals For example, the following queries are valid:
The following queries are invalid:
Invalid queries are rejected by the server with an |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | filter | Required. A query filter. You must specify at least one event type ( Optionally, you can also filter by start time (
To specify a start or end time, use the equals For example, the following queries are valid:
The following queries are invalid:
Invalid queries are rejected by the server with an |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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: |
string | filter | Required. A query filter. You must specify at least one event type ( Optionally, you can also filter by start time (
To specify a start or end time, use the equals For example, the following queries are valid:
The following queries are invalid:
Invalid queries are rejected by the server with an |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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.
Requires authentication. Supports app authentication and user authentication.
Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.
To list all named spaces by Google Workspace organization, use the
spaces.search()
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.
Requires authentication. Supports app authentication and user authentication.
Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.
To list all named spaces by Google Workspace organization, use the
spaces.search()
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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.
Requires authentication. Supports app authentication and user authentication.
Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.
To list all named spaces by Google Workspace organization, use the
spaces.search()
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.
Requires authentication. Supports app authentication and user authentication.
Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.
To list all named spaces by Google Workspace organization, use the
spaces.search()
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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 |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
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.
Requires user authentication.
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 |
FieldMask | updateMask | Required. The field paths to update. Separate multiple values with commas
or use Currently supported field paths:
|
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.
Requires user authentication.
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.
Requires user authentication.
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 |
FieldMask | updateMask | Required. The field paths to update. Separate multiple values with commas
or use Currently supported field paths:
|
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.
Requires user authentication.
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 |
FieldMask | updateMask | Required. The field paths to update. Separate multiple values with commas
or use Currently supported field paths:
|
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.
Requires user authentication.
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.
Requires user authentication.
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.
Requires authentication. Supports app authentication and 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 Currently supported field paths:
|
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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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 Currently supported field paths:
|
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.
Requires authentication. Supports app authentication and 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 Currently supported field paths:
|
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.
Requires authentication. Supports app authentication and 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.
Requires authentication. Supports app authentication and 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.
Requires user authentication.
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. |
FieldMask | updateMask | Required. The updated field paths, comma separated if there are multiple. You can update the following fields for a 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)
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.
Requires user authentication.
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.
Requires user authentication.
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. |
FieldMask | updateMask | Required. The updated field paths, comma separated if there are multiple. You can update the following fields for a 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)
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.
Requires user authentication.
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. |
FieldMask | updateMask | Required. The updated field paths, comma separated if there are multiple. You can update the following fields for a 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)
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.
Requires user authentication.
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.
Requires user authentication.
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);
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:
Format: users/{user}/spaces/{space}/spaceReadState |
FieldMask | updateMask | Required. The field paths to update. Currently supported field paths:
When the To mark the space as read, set |
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:
Format: users/{user}/spaces/{space}/spaceReadState |
FieldMask | updateMask | Required. The field paths to update. Currently supported field paths:
When the To mark the space as read, set |
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:
Format: users/{user}/spaces/{space}/spaceReadState |
FieldMask | updateMask | Required. The field paths to update. Currently supported field paths:
When the To mark the space as read, set |
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);