Class ChatServiceClientImpl
ChatService client wrapper implementation, for convenient use.
Inherited Members
Namespace: Google.Apps.Chat.V1
Assembly: Google.Apps.Chat.V1.dll
Syntax
public sealed class ChatServiceClientImpl : ChatServiceClient
Remarks
Enables developers to build Chat apps and integrations on Google Chat Platform.
Constructors
ChatServiceClientImpl(ChatServiceClient, ChatServiceSettings, ILogger)
Constructs a client wrapper for the ChatService service, with the specified gRPC client and settings.
Declaration
public ChatServiceClientImpl(ChatService.ChatServiceClient grpcClient, ChatServiceSettings settings, ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
ChatService.ChatServiceClient | grpcClient | The underlying gRPC client. |
ChatServiceSettings | settings | The base ChatServiceSettings used within this client. |
ILogger | logger | Optional ILogger to use within this client. |
Properties
GrpcClient
The underlying gRPC ChatService client
Declaration
public override ChatService.ChatServiceClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
ChatService.ChatServiceClient |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
ListReactions(ListReactionsRequest, CallSettings)
Lists reactions to a message. For an example, see List reactions for a message. Requires user authentication.
Declaration
public override 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. |
Overrides
ListReactionsAsync(ListReactionsRequest, CallSettings)
Lists reactions to a message. For an example, see List reactions for a message. Requires user authentication.
Declaration
public override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
UpdateMembership(UpdateMembershipRequest, CallSettings)
Updates a membership. For an example, see Update a user's membership in a space.
Requires user authentication.
Declaration
public override 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. |
Overrides
UpdateMembershipAsync(UpdateMembershipRequest, CallSettings)
Updates a membership. For an example, see Update a user's membership in a space.
Requires user authentication.
Declaration
public override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |
Overrides
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 override 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. |