Reference documentation and code samples for the Google Chat V1 API class Google::Apps::Chat::V1::ChatService::Rest::Client.
REST client for the ChatService service.
Enables developers to build Chat apps and integrations on Google Chat Platform.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the ChatService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ChatService clients ::Google::Apps::Chat::V1::ChatService::Rest::Client.configure do |config| config.timeout = 10.0 end
#complete_import_space
def complete_import_space(request, options = nil) -> ::Google::Apps::Chat::V1::CompleteImportSpaceResponse
def complete_import_space(name: nil) -> ::Google::Apps::Chat::V1::CompleteImportSpaceResponseCompletes the import process for the specified space and makes it visible to users.
Requires user authentication and domain-wide delegation with the authorization scope:
For more information, see Authorize Google Chat apps to import data.
def complete_import_space(request, options = nil) -> ::Google::Apps::Chat::V1::CompleteImportSpaceResponsecomplete_import_space via a request object, either of type
Google::Apps::Chat::V1::CompleteImportSpaceRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::CompleteImportSpaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def complete_import_space(name: nil) -> ::Google::Apps::Chat::V1::CompleteImportSpaceResponsecomplete_import_space via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the import mode space.
Format:
spaces/{space}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::CompleteImportSpaceResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::CompleteImportSpaceRequest.new # Call the complete_import_space method. result = client.complete_import_space request # The returned object is of type Google::Apps::Chat::V1::CompleteImportSpaceResponse. p result
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the ChatService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_custom_emoji
def create_custom_emoji(request, options = nil) -> ::Google::Apps::Chat::V1::CustomEmoji
def create_custom_emoji(custom_emoji: nil) -> ::Google::Apps::Chat::V1::CustomEmojiCreates a custom emoji.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with the authorization scope:
def create_custom_emoji(request, options = nil) -> ::Google::Apps::Chat::V1::CustomEmojicreate_custom_emoji via a request object, either of type
Google::Apps::Chat::V1::CreateCustomEmojiRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::CreateCustomEmojiRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_custom_emoji(custom_emoji: nil) -> ::Google::Apps::Chat::V1::CustomEmojicreate_custom_emoji via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- custom_emoji (::Google::Apps::Chat::V1::CustomEmoji, ::Hash) — Required. The custom emoji to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::CustomEmoji)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::CreateCustomEmojiRequest.new # Call the create_custom_emoji method. result = client.create_custom_emoji request # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. p result
#create_membership
def create_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def create_membership(parent: nil, membership: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::MembershipCreates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.memberships.app(to add the calling app to the space)https://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:
App authentication is not supported for the following use cases:
- Inviting users external to the Workspace organization that owns the space.
- Adding a Google Group to a space.
- Adding a Chat app to a space.
For example usage, see:
def create_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membershipcreate_membership via a request object, either of type
Google::Apps::Chat::V1::CreateMembershipRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::CreateMembershipRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_membership(parent: nil, membership: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::Membershipcreate_membership via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the space for which to create the
membership.
Format: spaces/{space}
-
membership (::Google::Apps::Chat::V1::Membership, ::Hash) — Required. The membership relation to create.
The
memberTypefield must contain a user with theuser.nameanduser.typefields populated. The server will assign a resource name and overwrite anything specified.When a Chat app creates a membership relation for a human user, it must use certain authorization scopes and set specific values for certain fields:
When authenticating as a user, the
chat.membershipsauthorization scope is required.When authenticating as an app, the
chat.app.membershipsauthorization scope is required.Set
user.typetoHUMAN, and setuser.namewith formatusers/{user}, where{user}can be the email address for the user. For users in the same Workspace organization{user}can also be theidof the person from the People API, or theidfor the user in the Directory API. For example, if the People API Person profile ID foruser@example.comis123456789, you can add the user to the space by setting themembership.member.nametousers/user@example.comorusers/123456789.
Inviting users external to the Workspace organization that owns the space requires user authentication.
When a Chat app creates a membership relation for itself, it must authenticate as a user and use the
chat.memberships.appscope, setuser.typetoBOT, and setuser.nametousers/app. -
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires the
chat.admin.membershipsOAuth 2.0 scope.Creating app memberships or creating memberships for users outside the administrator's Google Workspace organization isn't supported using admin access.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Membership)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::CreateMembershipRequest.new # Call the create_membership method. result = client.create_membership request # The returned object is of type Google::Apps::Chat::V1::Membership. p result
#create_message
def create_message(request, options = nil) -> ::Google::Apps::Chat::V1::Message
def create_message(parent: nil, message: nil, thread_key: nil, request_id: nil, message_reply_option: nil, message_id: nil) -> ::Google::Apps::Chat::V1::MessageCreates a message in a Google Chat space. For an example, see Send a message.
Supports the following types of authentication:
- App authentication with the authorization scope:
- User authentication with one of the following authorization scopes:
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.
For
webhook
requests, the response doesn't contain the full message. The response only
populates the name and thread.name fields in addition to the
information that was in the request.
def create_message(request, options = nil) -> ::Google::Apps::Chat::V1::Messagecreate_message via a request object, either of type
Google::Apps::Chat::V1::CreateMessageRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::CreateMessageRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_message(parent: nil, message: nil, thread_key: nil, request_id: nil, message_reply_option: nil, message_id: nil) -> ::Google::Apps::Chat::V1::Messagecreate_message via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the space in which to create a message.
Format:
spaces/{space} - message (::Google::Apps::Chat::V1::Message, ::Hash) — Required. Message body.
-
thread_key (::String) — Optional. Deprecated: Use
thread.thread_key instead. ID for the
thread. Supports up to 4000 characters. To start or add to a thread, create
a message and specify a
threadKeyor the thread.name. For example usage, see Start or reply to a message thread. - request_id (::String) — Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.
-
message_reply_option (::Google::Apps::Chat::V1::CreateMessageRequest::MessageReplyOption) — Optional. Specifies whether a message starts a thread or replies to one.
Only supported in named spaces.
When responding to user interactions, this field is ignored. For interactions within a thread, the reply is created in the same thread. Otherwise, the reply is created as a new thread.
-
message_id (::String) — 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
namefield).The value for this field must meet the following requirements:
- Begins with
client-. For example,client-custom-nameis a valid custom ID, butcustom-nameis not. - Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
- Is unique within a space. A Chat app can't use the same custom ID for different messages.
For details, see Name a message.
- Begins with
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Message)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::CreateMessageRequest.new # Call the create_message method. result = client.create_message request # The returned object is of type Google::Apps::Chat::V1::Message. p result
#create_reaction
def create_reaction(request, options = nil) -> ::Google::Apps::Chat::V1::Reaction
def create_reaction(parent: nil, reaction: nil) -> ::Google::Apps::Chat::V1::ReactionCreates a reaction and adds it to a message. For an example, see Add a reaction to a message.
Requires user authentication with one of the following authorization scopes:
def create_reaction(request, options = nil) -> ::Google::Apps::Chat::V1::Reactioncreate_reaction via a request object, either of type
Google::Apps::Chat::V1::CreateReactionRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::CreateReactionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_reaction(parent: nil, reaction: nil) -> ::Google::Apps::Chat::V1::Reactioncreate_reaction via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The message where the reaction is created.
Format:
spaces/{space}/messages/{message} - reaction (::Google::Apps::Chat::V1::Reaction, ::Hash) — Required. The reaction to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Reaction)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::CreateReactionRequest.new # Call the create_reaction method. result = client.create_reaction request # The returned object is of type Google::Apps::Chat::V1::Reaction. p result
#create_space
def create_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
def create_space(space: nil, request_id: nil) -> ::Google::Apps::Chat::V1::SpaceCreates a space. Can be used to create a named space, or a
group chat in Import mode. For an example, see Create a
space.
Supports the following types of authentication:
App authentication with administrator approval and one of the following authorization scopes:
User authentication with one of the following authorization scopes:
When authenticating as an app, the space.customer field must be set in
the request.
When authenticating as an app, the Chat app is added as a member of the
space. However, unlike human authentication, the Chat app is not added as a
space manager. By default, the Chat app can be removed from the space by
all space members. To allow only space managers to remove the app from a
space, set space.permission_settings.manage_apps to managers_allowed.
Space membership upon creation depends on whether the space is created in
Import mode:
- Import mode: No members are created.
- All other modes: The calling user is added as a member. This is:
- The app itself when using app authentication.
- The human user when using user authentication.
If you receive the error message ALREADY_EXISTS when creating
a space, try a different displayName. An existing space within
the Google Workspace organization might already use this display name.
def create_space(request, options = nil) -> ::Google::Apps::Chat::V1::Spacecreate_space via a request object, either of type
Google::Apps::Chat::V1::CreateSpaceRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::CreateSpaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_space(space: nil, request_id: nil) -> ::Google::Apps::Chat::V1::Spacecreate_space via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
space (::Google::Apps::Chat::V1::Space, ::Hash) — Required. The
displayNameandspaceTypefields must be populated. OnlySpaceType.SPACEandSpaceType.GROUP_CHATare supported.SpaceType.GROUP_CHATcan only be used ifimportModeis set to true.If you receive the error message
ALREADY_EXISTS, try a differentdisplayName. An existing space within the Google Workspace organization might already use this display name.The space
nameis assigned on the server so anything specified in this field will be ignored. - request_id (::String) — Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Space)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::CreateSpaceRequest.new # Call the create_space method. result = client.create_space request # The returned object is of type Google::Apps::Chat::V1::Space. p result
#delete_custom_emoji
def delete_custom_emoji(request, options = nil) -> ::Google::Protobuf::Empty
def delete_custom_emoji(name: nil) -> ::Google::Protobuf::EmptyDeletes a custom emoji. By default, users can only delete custom emoji they created. Emoji managers assigned by the administrator can delete any custom emoji in the organization. See Learn about custom emojis in Google Chat.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with the authorization scope:
def delete_custom_emoji(request, options = nil) -> ::Google::Protobuf::Emptydelete_custom_emoji via a request object, either of type
DeleteCustomEmojiRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_custom_emoji(name: nil) -> ::Google::Protobuf::Emptydelete_custom_emoji via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the custom emoji to delete.
Format:
customEmojis/{customEmoji}You can use the emoji name as an alias for
{customEmoji}. For example,customEmojis/:example-emoji:where:example-emoji:is the emoji name for a custom emoji.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::DeleteCustomEmojiRequest.new # Call the delete_custom_emoji method. result = client.delete_custom_emoji request # The returned object is of type Google::Protobuf::Empty. p result
#delete_membership
def delete_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def delete_membership(name: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::MembershipDeletes a membership. For an example, see Remove a user or a Google Chat app from a space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.memberships.app(to remove the calling app from the space)https://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:
App authentication is not supported for the following use cases:
- Removing a Google Group from a space.
- Removing a Chat app from a space.
To delete memberships for space managers, the requester must be a space manager. If you're using app authentication the Chat app must be the space creator.
def delete_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membershipdelete_membership via a request object, either of type
DeleteMembershipRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::DeleteMembershipRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_membership(name: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::Membershipdelete_membership via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the membership to delete. Chat apps can delete
human users' or their own memberships. Chat apps can't delete other apps'
memberships.
When deleting a human membership, requires the
chat.membershipsscope with user authentication or thechat.memberships.appscope with app authentication and thespaces/{space}/members/{member}format. You can use the email as an alias for{member}. For example,spaces/{space}/members/example@gmail.comwhereexample@gmail.comis the email of the Google Chat user.When deleting an app membership, requires the
chat.memberships.appscope andspaces/{space}/members/appformat.Format:
spaces/{space}/members/{member}orspaces/{space}/members/app. -
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires the
chat.admin.membershipsOAuth 2.0 scope.Deleting app memberships in a space isn't supported using admin access.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Membership)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::DeleteMembershipRequest.new # Call the delete_membership method. result = client.delete_membership request # The returned object is of type Google::Apps::Chat::V1::Membership. p result
#delete_message
def delete_message(request, options = nil) -> ::Google::Protobuf::Empty
def delete_message(name: nil, force: nil) -> ::Google::Protobuf::EmptyDeletes a message. For an example, see Delete a message.
Supports the following types of authentication:
App authentication with the authorization scope:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
When using app authentication, requests can only delete messages created by the calling Chat app.
def delete_message(request, options = nil) -> ::Google::Protobuf::Emptydelete_message via a request object, either of type
DeleteMessageRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::DeleteMessageRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_message(name: nil, force: nil) -> ::Google::Protobuf::Emptydelete_message via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the message.
Format:
spaces/{space}/messages/{message}If you've set a custom ID for your message, you can use the value from the
clientAssignedMessageIdfield for{message}. For details, see Name a message. -
force (::Boolean) — Optional. When
true, deleting a message also deletes its threaded replies. Whenfalse, if a message has threaded replies, deletion fails.Only applies when authenticating as a user. Has no effect when authenticating as a Chat app.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::DeleteMessageRequest.new # Call the delete_message method. result = client.delete_message request # The returned object is of type Google::Protobuf::Empty. p result
#delete_reaction
def delete_reaction(request, options = nil) -> ::Google::Protobuf::Empty
def delete_reaction(name: nil) -> ::Google::Protobuf::EmptyDeletes a reaction to a message. For an example, see Delete a reaction.
Requires user authentication with one of the following authorization scopes:
def delete_reaction(request, options = nil) -> ::Google::Protobuf::Emptydelete_reaction via a request object, either of type
DeleteReactionRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::DeleteReactionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_reaction(name: nil) -> ::Google::Protobuf::Emptydelete_reaction via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Name of the reaction to delete.
Format:
spaces/{space}/messages/{message}/reactions/{reaction}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::DeleteReactionRequest.new # Call the delete_reaction method. result = client.delete_reaction request # The returned object is of type Google::Protobuf::Empty. p result
#delete_space
def delete_space(request, options = nil) -> ::Google::Protobuf::Empty
def delete_space(name: nil, use_admin_access: nil) -> ::Google::Protobuf::EmptyDeletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see Delete a space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
https://www.googleapis.com/auth/chat.app.delete(only in spaces the app created)
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.deletehttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:
def delete_space(request, options = nil) -> ::Google::Protobuf::Emptydelete_space via a request object, either of type
DeleteSpaceRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::DeleteSpaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_space(name: nil, use_admin_access: nil) -> ::Google::Protobuf::Emptydelete_space via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the space to delete.
Format:
spaces/{space} -
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires the
chat.admin.deleteOAuth 2.0 scope.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::DeleteSpaceRequest.new # Call the delete_space method. result = client.delete_space request # The returned object is of type Google::Protobuf::Empty. p result
#find_direct_message
def find_direct_message(request, options = nil) -> ::Google::Apps::Chat::V1::Space
def find_direct_message(name: nil) -> ::Google::Apps::Chat::V1::SpaceReturns the existing direct message with the specified user. If no direct
message space is found, returns a 404 NOT_FOUND error. For an example,
see
Find a direct message.
With app authentication, returns the direct message space between the specified user and the calling Chat app.
With user authentication, returns the direct message space between the specified user and the authenticated user.
Supports the following types of authentication:
App authentication with the authorization scope:
User authentication with one of the following authorization scopes:
def find_direct_message(request, options = nil) -> ::Google::Apps::Chat::V1::Spacefind_direct_message via a request object, either of type
FindDirectMessageRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def find_direct_message(name: nil) -> ::Google::Apps::Chat::V1::Spacefind_direct_message via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the user to find direct message with.
Format:
users/{user}, where{user}is either theidfor the person from the People API, or theidfor the user in the Directory API. For example, if the People API profile ID is123456789, you can find a direct message with that person by usingusers/123456789as thename. When authenticated as a user, you can use the email as an alias for{user}. For example,users/example@gmail.comwhereexample@gmail.comis the email of the Google Chat user.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Space)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::FindDirectMessageRequest.new # Call the find_direct_message method. result = client.find_direct_message request # The returned object is of type Google::Apps::Chat::V1::Space. p result
#get_attachment
def get_attachment(request, options = nil) -> ::Google::Apps::Chat::V1::Attachment
def get_attachment(name: nil) -> ::Google::Apps::Chat::V1::AttachmentGets 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 with the authorization scope:
def get_attachment(request, options = nil) -> ::Google::Apps::Chat::V1::Attachmentget_attachment via a request object, either of type
GetAttachmentRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetAttachmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_attachment(name: nil) -> ::Google::Apps::Chat::V1::Attachmentget_attachment via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the attachment, in the form
spaces/{space}/messages/{message}/attachments/{attachment}.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Attachment)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetAttachmentRequest.new # Call the get_attachment method. result = client.get_attachment request # The returned object is of type Google::Apps::Chat::V1::Attachment. p result
#get_custom_emoji
def get_custom_emoji(request, options = nil) -> ::Google::Apps::Chat::V1::CustomEmoji
def get_custom_emoji(name: nil) -> ::Google::Apps::Chat::V1::CustomEmojiReturns details about a custom emoji.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with one of the following authorization scopes:
def get_custom_emoji(request, options = nil) -> ::Google::Apps::Chat::V1::CustomEmojiget_custom_emoji via a request object, either of type
GetCustomEmojiRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetCustomEmojiRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_custom_emoji(name: nil) -> ::Google::Apps::Chat::V1::CustomEmojiget_custom_emoji via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the custom emoji.
Format:
customEmojis/{customEmoji}You can use the emoji name as an alias for
{customEmoji}. For example,customEmojis/:example-emoji:where:example-emoji:is the emoji name for a custom emoji.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::CustomEmoji)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetCustomEmojiRequest.new # Call the get_custom_emoji method. result = client.get_custom_emoji request # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. p result
#get_membership
def get_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def get_membership(name: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::MembershipReturns details about a membership. For an example, see Get details about a user's or Google Chat app's membership.
Supports the following types of authentication:
App authentication with one of the following authorization scopes:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and one of the following authorization scopes is used:
def get_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membershipget_membership via a request object, either of type
GetMembershipRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetMembershipRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_membership(name: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::Membershipget_membership via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the membership to retrieve.
To get the app's own membership by using user authentication, you can optionally use
spaces/{space}/members/app.Format:
spaces/{space}/members/{member}orspaces/{space}/members/appYou can use the user's email as an alias for
{member}. For example,spaces/{space}/members/example@gmail.comwhereexample@gmail.comis the email of the Google Chat user. -
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires the
chat.admin.membershipsorchat.admin.memberships.readonlyOAuth 2.0 scopes.Getting app memberships in a space isn't supported when using admin access.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Membership)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetMembershipRequest.new # Call the get_membership method. result = client.get_membership request # The returned object is of type Google::Apps::Chat::V1::Membership. p result
#get_message
def get_message(request, options = nil) -> ::Google::Apps::Chat::V1::Message
def get_message(name: nil) -> ::Google::Apps::Chat::V1::MessageReturns details about a message. For an example, see Get details about a message.
Supports the following types of authentication:
App authentication with the authorization scope:
User authentication with one of the following authorization scopes:
Note: Might return a message from a blocked member or space.
def get_message(request, options = nil) -> ::Google::Apps::Chat::V1::Messageget_message via a request object, either of type
GetMessageRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetMessageRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_message(name: nil) -> ::Google::Apps::Chat::V1::Messageget_message via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the message.
Format:
spaces/{space}/messages/{message}If you've set a custom ID for your message, you can use the value from the
clientAssignedMessageIdfield for{message}. For details, see Name a message.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Message)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetMessageRequest.new # Call the get_message method. result = client.get_message request # The returned object is of type Google::Apps::Chat::V1::Message. p result
#get_space
def get_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
def get_space(name: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::SpaceReturns details about a space. For an example, see Get details about a space.
Supports the following types of authentication:
App authentication with one of the following authorization scopes:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaces- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and one of the following authorization scopes is used:
App authentication has the following limitations:
space.access_settingsis only populated when using thechat.app.spacesscope.space.predefind_permission_settingsandspace.permission_settingsare only populated when using thechat.app.spacesscope, and only for spaces the app created.
def get_space(request, options = nil) -> ::Google::Apps::Chat::V1::Spaceget_space via a request object, either of type
GetSpaceRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetSpaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_space(name: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::Spaceget_space via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the space, in the form
spaces/{space}.Format:
spaces/{space} -
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires the
chat.admin.spacesorchat.admin.spaces.readonlyOAuth 2.0 scopes.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Space)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetSpaceRequest.new # Call the get_space method. result = client.get_space request # The returned object is of type Google::Apps::Chat::V1::Space. p result
#get_space_event
def get_space_event(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceEvent
def get_space_event(name: nil) -> ::Google::Apps::Chat::V1::SpaceEventReturns 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 with an authorization scope appropriate for reading the requested data:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.messages.reactions.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships
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.
def get_space_event(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceEventget_space_event via a request object, either of type
GetSpaceEventRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetSpaceEventRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_space_event(name: nil) -> ::Google::Apps::Chat::V1::SpaceEventget_space_event via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the space event.
Format:
spaces/{space}/spaceEvents/{spaceEvent}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::SpaceEvent)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetSpaceEventRequest.new # Call the get_space_event method. result = client.get_space_event request # The returned object is of type Google::Apps::Chat::V1::SpaceEvent. p result
#get_space_notification_setting
def get_space_notification_setting(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSetting
def get_space_notification_setting(name: nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSettingGets the space notification setting. For an example, see Get the caller's space notification setting.
Requires user authentication with the authorization scope:
def get_space_notification_setting(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSettingget_space_notification_setting via a request object, either of type
GetSpaceNotificationSettingRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_space_notification_setting(name: nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSettingget_space_notification_setting via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) —
Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting
users/me/spaces/{space}/spaceNotificationSetting, ORusers/user@example.com/spaces/{space}/spaceNotificationSetting, ORusers/123456789/spaces/{space}/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::SpaceNotificationSetting)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.new # Call the get_space_notification_setting method. result = client.get_space_notification_setting request # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. p result
#get_space_read_state
def get_space_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceReadState
def get_space_read_state(name: nil) -> ::Google::Apps::Chat::V1::SpaceReadStateReturns 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 with one of the following authorization scopes:
def get_space_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceReadStateget_space_read_state via a request object, either of type
GetSpaceReadStateRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetSpaceReadStateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_space_read_state(name: nil) -> ::Google::Apps::Chat::V1::SpaceReadStateget_space_read_state via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the space read state to retrieve.
Only supports getting read state for the calling user.
To refer to the calling user, set one of the following:
The
mealias. For example,users/me/spaces/{space}/spaceReadState.Their Workspace email address. For example,
users/user@example.com/spaces/{space}/spaceReadState.Their user id. For example,
users/123456789/spaces/{space}/spaceReadState.
Format: users/{user}/spaces/{space}/spaceReadState
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::SpaceReadState)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetSpaceReadStateRequest.new # Call the get_space_read_state method. result = client.get_space_read_state request # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. p result
#get_thread_read_state
def get_thread_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::ThreadReadState
def get_thread_read_state(name: nil) -> ::Google::Apps::Chat::V1::ThreadReadStateReturns 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 with one of the following authorization scopes:
def get_thread_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::ThreadReadStateget_thread_read_state via a request object, either of type
GetThreadReadStateRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::GetThreadReadStateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_thread_read_state(name: nil) -> ::Google::Apps::Chat::V1::ThreadReadStateget_thread_read_state via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Resource name of the thread read state to retrieve.
Only supports getting read state for the calling user.
To refer to the calling user, set one of the following:
The
mealias. For example,users/me/spaces/{space}/threads/{thread}/threadReadState.Their Workspace email address. For example,
users/user@example.com/spaces/{space}/threads/{thread}/threadReadState.Their user id. For example,
users/123456789/spaces/{space}/threads/{thread}/threadReadState.
Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::ThreadReadState)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::GetThreadReadStateRequest.new # Call the get_thread_read_state method. result = client.get_thread_read_state request # The returned object is of type Google::Apps::Chat::V1::ThreadReadState. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new ChatService REST client object.
- (config) — Configure the ChatService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_custom_emojis
def list_custom_emojis(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>
def list_custom_emojis(page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>Lists custom emojis visible to the authenticated user.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with one of the following authorization scopes:
def list_custom_emojis(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>list_custom_emojis via a request object, either of type
ListCustomEmojisRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::ListCustomEmojisRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_custom_emojis(page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>list_custom_emojis via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- page_size (::Integer) — Optional. The maximum number of custom emojis returned. The service can return fewer custom emojis than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200.
-
page_token (::String) — Optional. (If resuming from a previous query.)
A page token received from a previous list custom emoji call. Provide this to retrieve the subsequent page.
When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.
-
filter (::String) — Optional. A query filter.
Supports filtering by creator.
To filter by creator, you must specify a valid value. Currently only
creator("users/me")andNOT creator("users/me")are accepted to filter custom emojis by whether they were created by the calling user or not.For example, the following query returns custom emojis created by the caller:
creator("users/me")Invalid queries are rejected with an
INVALID_ARGUMENTerror.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::ListCustomEmojisRequest.new # Call the list_custom_emojis method. result = client.list_custom_emojis request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Apps::Chat::V1::CustomEmoji. p item end
#list_memberships
def list_memberships(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>
def list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, show_groups: nil, show_invited: nil, use_admin_access: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>Lists memberships in a space. For an example, see List users and Google Chat apps in a space. Listing memberships with app authentication lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with User authentication lists memberships in spaces that the authenticated user has access to.
Supports the following types of authentication:
App authentication with one of the following authorization scopes:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and one of the following authorization scopes is used:
def list_memberships(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>list_memberships via a request object, either of type
ListMembershipsRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::ListMembershipsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, show_groups: nil, show_invited: nil, use_admin_access: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>list_memberships via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the space for which to fetch a membership
list.
Format: spaces/{space}
-
page_size (::Integer) — Optional. The maximum number of memberships to return. The service might
return fewer than this value.
If unspecified, at most 100 memberships are returned.
The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.
Negative values return an
INVALID_ARGUMENTerror. -
page_token (::String) — Optional. A page token, received from a previous call to list memberships.
Provide this parameter to retrieve the subsequent page.
When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
-
filter (::String) — Optional. A query filter.
You can filter memberships by a member's role (
role) and type (member.type).To filter by role, set
roletoROLE_MEMBERorROLE_MANAGER.To filter by type, set
member.typetoHUMANorBOT. You can also filter formember.typeusing the!=operator.To filter by both role and type, use the
ANDoperator. To filter by either role or type, use theORoperator.Either
member.type = "HUMAN"ormember.type != "BOT"is required whenuse_admin_accessis set to true. Other member type filters will be rejected.For example, the following queries are valid:
``` role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" member.type = "HUMAN" AND role = "ROLE_MANAGER"
member.type != "BOT" ```
The following queries are invalid:
member.type = "HUMAN" AND member.type = "BOT" role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"Invalid queries are rejected by the server with an
INVALID_ARGUMENTerror. -
show_groups (::Boolean) — Optional. When
true, also returns memberships associated with a Google Group, in addition to other types of memberships. If a filter is set, Google Group memberships that don't match the filter criteria aren't returned. -
show_invited (::Boolean) — Optional. When
true, also returns memberships associated with invited members, in addition to other types of memberships. If a filter is set, invited memberships that don't match the filter criteria aren't returned.Currently requires user authentication.
-
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires either the
chat.admin.memberships.readonlyorchat.admin.membershipsOAuth 2.0 scope.Listing app memberships in a space isn't supported when using admin access.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::ListMembershipsRequest.new # Call the list_memberships method. result = client.list_memberships request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Apps::Chat::V1::Membership. p item end
#list_messages
def list_messages(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>
def list_messages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>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 with one of the following authorization scopes:
def list_messages(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>list_messages via a request object, either of type
ListMessagesRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::ListMessagesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_messages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>list_messages via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the space to list messages from.
Format:
spaces/{space} -
page_size (::Integer) — Optional. The maximum number of messages returned. The service might return
fewer messages than this value.
If unspecified, at most 25 are returned.
The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.
Negative values return an
INVALID_ARGUMENTerror. -
page_token (::String) — Optional. A page token received from a previous list messages call. Provide
this parameter to retrieve the subsequent page.
When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
-
filter (::String) — Optional. A query filter.
You can filter messages by date (
create_time) and thread (thread.name).To filter messages by the date they were created, specify the
create_timewith a timestamp in RFC-3339 format and double quotation marks. For example,"2023-04-21T11:30:00-04:00". You can use the greater than operator>to list messages that were created after a timestamp, or the less than operator<to list messages that were created before a timestamp. To filter messages within a time interval, use theANDoperator between two timestamps.To filter by thread, specify the
thread.name, formatted asspaces/{space}/threads/{thread}. You can only specify onethread.nameper query.To filter by both thread and date, use the
ANDoperator in your query.For example, the following queries are valid:
``` create_time > "2012-04-21T11:30:00-04:00"
create_time > "2012-04-21T11:30:00-04:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123
create_time > "2012-04-21T11:30:00+00:00" AND
create_time < "2013-01-01T00:00:00+00:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123
thread.name = spaces/AAAAAAAAAAA/threads/123 ```
Invalid queries are rejected by the server with an
INVALID_ARGUMENTerror. -
order_by (::String) — Optional. How the list of messages is ordered. Specify a value to order by
an ordering operation. Valid ordering operation values are as follows:
ASCfor ascending.DESCfor descending.
The default ordering is
create_time ASC. - show_deleted (::Boolean) — Optional. Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::ListMessagesRequest.new # Call the list_messages method. result = client.list_messages request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Apps::Chat::V1::Message. p item end
#list_reactions
def list_reactions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>
def list_reactions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>Lists reactions to a message. For an example, see List reactions for a message.
Requires user authentication with one of the following authorization scopes:
def list_reactions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>list_reactions via a request object, either of type
ListReactionsRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::ListReactionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_reactions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>list_reactions via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The message users reacted to.
Format:
spaces/{space}/messages/{message} - page_size (::Integer) — Optional. The maximum number of reactions returned. The service can return fewer reactions than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200.
-
page_token (::String) — Optional. (If resuming from a previous query.)
A page token received from a previous list reactions call. Provide this to retrieve the subsequent page.
When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.
-
filter (::String) — Optional. A query filter.
You can filter reactions by emoji (either
emoji.unicodeoremoji.custom_emoji.uid) and user (user.name).To filter reactions for multiple emojis or users, join similar fields with the
ORoperator, such asemoji.unicode = "🙂" OR emoji.unicode = "👍"anduser.name = "users/AAAAAA" OR user.name = "users/BBBBBB".To filter reactions by emoji and user, use the
ANDoperator, such asemoji.unicode = "🙂" AND user.name = "users/AAAAAA".If your query uses both
ANDandOR, group them with parentheses.For example, the following queries are valid:
user.name = "users/\\{user}" emoji.unicode = "🙂" emoji.custom_emoji.uid = "\\{uid}" emoji.unicode = "🙂" OR emoji.unicode = "👍" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}" emoji.unicode = "🙂" AND user.name = "users/\\{user}" (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}") AND user.name = "users/\\{user}"The following queries are invalid:
emoji.unicode = "🙂" AND emoji.unicode = "👍" emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "\\{uid}" emoji.unicode = "🙂" OR user.name = "users/\\{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}" OR user.name = "users/\\{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}" AND user.name = "users/\\{user}"Invalid queries are rejected with an
INVALID_ARGUMENTerror.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::ListReactionsRequest.new # Call the list_reactions method. result = client.list_reactions request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Apps::Chat::V1::Reaction. p item end
#list_space_events
def list_space_events(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>
def list_space_events(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>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 with an authorization scope appropriate for reading the requested data:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.messages.reactions.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships
To list events, the authenticated user must be a member of the space.
For an example, see List events from a Google Chat space.
def list_space_events(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>list_space_events via a request object, either of type
ListSpaceEventsRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::ListSpaceEventsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_space_events(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>list_space_events via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. Resource name of the Google Chat
space
where the events occurred.
Format:
spaces/{space}. -
page_size (::Integer) — Optional. The maximum number of space events returned. The service might
return fewer than this value.
Negative values return an
INVALID_ARGUMENTerror. -
page_token (::String) — Optional. A page token, received from a previous list space events call.
Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to list space events must match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
-
filter (::String) — Required. A query filter.
You must specify at least one event type (
event_type) using the has:operator. To filter by multiple event types, use theORoperator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions (google.workspace.chat.reaction.v1.created), the server also returns batch new reactions events (google.workspace.chat.reaction.v1.batchCreated). For a list of supported event types, see theSpaceEventsreference documentation.Optionally, you can also filter by start time (
start_time) and end time (end_time):start_time: Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.end_time: Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.
To specify a start or end time, use the equals
=operator and format in RFC-3339. To filter by bothstart_timeandend_time, use theANDoperator.For example, the following queries are valid:
start_time="2023-08-23T19:20:33+00:00" AND end_time="2023-08-23T19:21:54+00:00"start_time="2023-08-23T19:20:33+00:00" AND (event_types:"google.workspace.chat.space.v1.updated" OR event_types:"google.workspace.chat.message.v1.created")The following queries are invalid:
start_time="2023-08-23T19:20:33+00:00" OR end_time="2023-08-23T19:21:54+00:00"event_types:"google.workspace.chat.space.v1.updated" AND event_types:"google.workspace.chat.message.v1.created"Invalid queries are rejected by the server with an
INVALID_ARGUMENTerror.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::ListSpaceEventsRequest.new # Call the list_space_events method. result = client.list_space_events request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Apps::Chat::V1::SpaceEvent. p item end
#list_spaces
def list_spaces(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>
def list_spaces(page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see List spaces.
Supports the following types of authentication:
App authentication with the authorization scope:
User authentication with one of the following authorization scopes:
To list all named spaces by Google Workspace organization, use the
spaces.search()
method using Workspace administrator privileges instead.
def list_spaces(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>list_spaces via a request object, either of type
ListSpacesRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::ListSpacesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_spaces(page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>list_spaces via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
page_size (::Integer) — Optional. The maximum number of spaces to return. The service might return
fewer than this value.
If unspecified, at most 100 spaces are returned.
The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.
Negative values return an
INVALID_ARGUMENTerror. -
page_token (::String) — Optional. A page token, received from a previous list spaces call.
Provide this parameter to retrieve the subsequent page.
When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results.
-
filter (::String) — Optional. A query filter.
You can filter spaces by the space type (
space_type).To filter by space type, you must specify valid enum value, such as
SPACEorGROUP_CHAT(thespace_typecan't beSPACE_TYPE_UNSPECIFIED). To query for multiple space types, use theORoperator.For example, the following queries are valid:
space_type = "SPACE" spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"Invalid queries are rejected by the server with an
INVALID_ARGUMENTerror.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::ListSpacesRequest.new # Call the list_spaces method. result = client.list_spaces request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Apps::Chat::V1::Space. p item end
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#search_spaces
def search_spaces(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>
def search_spaces(use_admin_access: nil, page_size: nil, page_token: nil, query: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>Returns a list of spaces in a Google Workspace organization based on an administrator's search.
Requires user authentication with administrator privileges and one of the following authorization scopes:
https://www.googleapis.com/auth/chat.admin.spaces.readonlyhttps://www.googleapis.com/auth/chat.admin.spaces
In the request, set use_admin_access to true.
def search_spaces(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>search_spaces via a request object, either of type
SearchSpacesRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::SearchSpacesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def search_spaces(use_admin_access: nil, page_size: nil, page_token: nil, query: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>search_spaces via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
use_admin_access (::Boolean) — When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires either the
chat.admin.spaces.readonlyorchat.admin.spacesOAuth 2.0 scope.This method currently only supports admin access, thus only
trueis accepted for this field. -
page_size (::Integer) — The maximum number of spaces to return. The service may return fewer than
this value.
If unspecified, at most 100 spaces are returned.
The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.
-
page_token (::String) — A token, received from the previous search spaces call. Provide this
parameter to retrieve the subsequent page.
When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
-
query (::String) — Required. A search query.
You can search by using the following parameters:
create_timecustomerdisplay_nameexternal_user_allowedlast_active_timespace_history_statespace_type
create_timeandlast_active_timeaccept a timestamp in RFC-3339 format and the supported comparison operators are:=,<,>,<=,>=.customeris required and is used to indicate which customer to fetch spaces from.customers/my_customeris the only supported value.display_nameonly accepts theHAS(:) operator. The text to match is first tokenized into tokens and each token is prefix-matched case-insensitively and independently as a substring anywhere in the space'sdisplay_name. For example,Fun EvematchesFun eventorThe evening was fun, but notnotFun eventoreven.external_user_allowedaccepts eithertrueorfalse.space_history_stateonly accepts values from thehistoryStatefield of aspaceresource.space_typeis required and the only valid value isSPACE.Across different fields, only
ANDoperators are supported. A valid example isspace_type = "SPACE" AND display_name:"Hello"and an invalid example isspace_type = "SPACE" OR display_name:"Hello".Among the same field,
space_typedoesn't supportANDorORoperators.display_name, 'space_history_state', and 'external_user_allowed' only supportORoperators.last_active_timeandcreate_timesupport bothANDandORoperators.ANDcan only be used to represent an interval, such aslast_active_time < "2022-01-01T00:00:00+00:00" AND last_active_time > "2023-01-01T00:00:00+00:00".The following example queries are valid:
``` customer = "customers/my_customer" AND space_type = "SPACE"
customer = "customers/my_customer" AND space_type = "SPACE" AND display_name:"Hello World"
customer = "customers/my_customer" AND space_type = "SPACE" AND (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > "2022-01-01T00:00:00+00:00")
customer = "customers/my_customer" AND space_type = "SPACE" AND (display_name:"Hello World" OR display_name:"Fun event") AND (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < "2022-01-01T00:00:00+00:00")
customer = "customers/my_customer" AND space_type = "SPACE" AND (create_time > "2019-01-01T00:00:00+00:00" AND create_time < "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") ```
-
order_by (::String) —
Optional. How the list of spaces is ordered.
Supported attributes to order by are:
membership_count.joined_direct_human_user_count— Denotes the count of human users that have directly joined a space.last_active_time— Denotes the time when last eligible item is added to any topic of this space.create_time— Denotes the time of the space creation.
Valid ordering operation values are:
ASCfor ascending. Default value.DESCfor descending.
The supported syntax are:
membership_count.joined_direct_human_user_count DESCmembership_count.joined_direct_human_user_count ASClast_active_time DESClast_active_time ASCcreate_time DESCcreate_time ASC
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::SearchSpacesRequest.new # Call the search_spaces method. result = client.search_spaces request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Apps::Chat::V1::Space. p item end
#set_up_space
def set_up_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
def set_up_space(space: nil, request_id: nil, memberships: nil) -> ::Google::Apps::Chat::V1::SpaceCreates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see Set up a space with initial members.
To specify the human members to add, add memberships with the appropriate
membership.member.name. To add a human user, use users/{user}, where
{user} can be the email address for the user. For users in the same
Workspace organization {user} can also be the id for the person from
the People API, or the id for the user in the Directory API. For example,
if the People API Person profile ID for user@example.com is 123456789,
you can add the user to the space by setting the membership.member.name
to users/user@example.com or users/123456789.
To specify the Google groups to add, add memberships with the
appropriate membership.group_member.name. To add or invite a Google
group, use groups/{group}, where {group} is the id for the group from
the Cloud Identity Groups API. For example, you can use Cloud Identity
Groups lookup
API
to retrieve the ID 123456789 for group email group@example.com, then
you can add the group to the space by setting the
membership.group_member.name to groups/123456789. Group email is not
supported, and Google groups can only be added as members in named spaces.
For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space.
To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created.
To create a DM between the calling user and the calling app, set
Space.singleUserBotDm to true and don't specify any memberships. You
can only use this method to set up a DM with the calling app. To add the
calling app as a member of a space or an existing DM between two human
users, see
Invite or add a user or app to a
space.
If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned.
Spaces with threaded replies aren't supported. If you receive the error
message ALREADY_EXISTS when setting up a space, try a different
displayName. An existing space within the Google Workspace organization
might already use this display name.
Requires user authentication with one of the following authorization scopes:
def set_up_space(request, options = nil) -> ::Google::Apps::Chat::V1::Spaceset_up_space via a request object, either of type
SetUpSpaceRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::SetUpSpaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def set_up_space(space: nil, request_id: nil, memberships: nil) -> ::Google::Apps::Chat::V1::Spaceset_up_space via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
space (::Google::Apps::Chat::V1::Space, ::Hash) — Required. The
Space.spaceTypefield is required.To create a space, set
Space.spaceTypetoSPACEand setSpace.displayName. If you receive the error messageALREADY_EXISTSwhen setting up a space, try a differentdisplayName. An existing space within the Google Workspace organization might already use this display name.To create a group chat, set
Space.spaceTypetoGROUP_CHAT. Don't setSpace.displayName.To create a 1:1 conversation between humans, set
Space.spaceTypetoDIRECT_MESSAGEand setSpace.singleUserBotDmtofalse. Don't setSpace.displayNameorSpace.spaceDetails.To create an 1:1 conversation between a human and the calling Chat app, set
Space.spaceTypetoDIRECT_MESSAGEandSpace.singleUserBotDmtotrue. Don't setSpace.displayNameorSpace.spaceDetails.If a
DIRECT_MESSAGEspace already exists, that space is returned instead of creating a new space. - request_id (::String) — Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error.
-
memberships (::Array<::Google::Apps::Chat::V1::Membership, ::Hash>) — Optional. The Google Chat users or groups to invite to join the space. Omit
the calling user, as they are added automatically.
The set currently allows up to 49 memberships (in addition to the caller).
For human membership, the
Membership.memberfield must contain auserwithnamepopulated (format:users/{user}) andtypeset toUser.Type.HUMAN. You can only add human users when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user's email as an alias for {user}. For example, theuser.namecan beusers/example@gmail.com. To invite Gmail users or users from external Google Workspace domains, user's email must be used for{user}.For Google group membership, the
Membership.group_memberfield must contain agroupwithnamepopulated (formatgroups/{group}). You can only add Google groups when settingSpace.spaceTypetoSPACE.Optional when setting
Space.spaceTypetoSPACE.Required when setting
Space.spaceTypetoGROUP_CHAT, along with at least two memberships.Required when setting
Space.spaceTypetoDIRECT_MESSAGEwith a human user, along with exactly one membership.Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting
Space.spaceTypetoDIRECT_MESSAGEandSpace.singleUserBotDmtotrue).
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Space)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::SetUpSpaceRequest.new # Call the set_up_space method. result = client.set_up_space request # The returned object is of type Google::Apps::Chat::V1::Space. p result
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_membership
def update_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def update_membership(membership: nil, update_mask: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::MembershipUpdates a membership. For an example, see Update a user's membership in a space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
https://www.googleapis.com/auth/chat.app.memberships(only in spaces the app created)
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:
def update_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membershipupdate_membership via a request object, either of type
UpdateMembershipRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::UpdateMembershipRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_membership(membership: nil, update_mask: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::Membershipupdate_membership via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
membership (::Google::Apps::Chat::V1::Membership, ::Hash) — Required. The membership to update. Only fields specified by
update_maskare updated. -
update_mask (::Google::Protobuf::FieldMask, ::Hash) —
Required. The field paths to update. Separate multiple values with commas or use
*to update all field paths.Currently supported field paths:
role
-
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires the
chat.admin.membershipsOAuth 2.0 scope.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Membership)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::UpdateMembershipRequest.new # Call the update_membership method. result = client.update_membership request # The returned object is of type Google::Apps::Chat::V1::Membership. p result
#update_message
def update_message(request, options = nil) -> ::Google::Apps::Chat::V1::Message
def update_message(message: nil, update_mask: nil, allow_missing: nil) -> ::Google::Apps::Chat::V1::MessageUpdates a message. There's a difference between the patch and update
methods. The patch
method uses a patch request while the update method uses a put
request. We recommend using the patch method. For an example, see
Update a
message.
Supports the following types of authentication:
App authentication with the authorization scope:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
When using app authentication, requests can only update messages created by the calling Chat app.
def update_message(request, options = nil) -> ::Google::Apps::Chat::V1::Messageupdate_message via a request object, either of type
UpdateMessageRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::UpdateMessageRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_message(message: nil, update_mask: nil, allow_missing: nil) -> ::Google::Apps::Chat::V1::Messageupdate_message via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- message (::Google::Apps::Chat::V1::Message, ::Hash) — Required. Message with fields updated.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) —
Required. The field paths to update. Separate multiple values with commas or use
*to update all field paths.Currently supported field paths:
textattachmentcards(Requires app authentication.)cards_v2(Requires app authentication.)accessory_widgets(Requires app authentication.)quoted_message_metadata(Only allows removal of the quoted message.)
-
allow_missing (::Boolean) — Optional. If
trueand the message isn't found, a new message is created andupdateMaskis ignored. The specified message ID must be client-assigned or the request fails.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Message)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::UpdateMessageRequest.new # Call the update_message method. result = client.update_message request # The returned object is of type Google::Apps::Chat::V1::Message. p result
#update_space
def update_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
def update_space(space: nil, update_mask: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::SpaceUpdates a space. For an example, see Update a space.
If you're updating the displayName field and receive the error message
ALREADY_EXISTS, try a different display name.. An existing space within
the Google Workspace organization might already use this display name.
Supports the following types of authentication:
App authentication with administrator approval and one of the following authorization scopes:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scopes is used:
App authentication has the following limitations:
- To update either
space.predefined_permission_settingsorspace.permission_settings, the app must be the space creator. - Updating the
space.access_settings.audienceis not supported for app authentication.
def update_space(request, options = nil) -> ::Google::Apps::Chat::V1::Spaceupdate_space via a request object, either of type
UpdateSpaceRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::UpdateSpaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_space(space: nil, update_mask: nil, use_admin_access: nil) -> ::Google::Apps::Chat::V1::Spaceupdate_space via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
space (::Google::Apps::Chat::V1::Space, ::Hash) — Required. Space with fields to be updated.
Space.namemust be populated in the form ofspaces/{space}. Only fields specified byupdate_maskare updated. -
update_mask (::Google::Protobuf::FieldMask, ::Hash) —
Required. The updated field paths, comma separated if there are multiple.
You can update the following fields for a space:
space_details: Updates the space's description. Supports up to 150 characters.display_name: Only supports updating the display name for spaces wherespaceTypefield isSPACE. If you receive the error messageALREADY_EXISTS, try a different value. An existing space within the Google Workspace organization might already use this display name.space_type: Only supports changing aGROUP_CHATspace type toSPACE. Includedisplay_nametogether withspace_typein the update mask and ensure that the specified space has a non-empty display name and theSPACEspace type. Including thespace_typemask and theSPACEtype in the specified space when updating the display name is optional if the existing space already has theSPACEtype. Trying to update the space type in other ways results in an invalid argument error.space_typeis not supported withuseAdminAccess.space_history_state: Updates space history settings by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request.space_history_stateis not supported withuseAdminAccess.access_settings.audience: Updates the access setting of who can discover the space, join the space, and preview the messages in named space wherespaceTypefield isSPACE. If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can't update this field if the space is in import mode. To learn more, see Make a space discoverable to specific users.access_settings.audienceis not supported withuseAdminAccess.permission_settings: Supports changing the permission settings of a space. When updating permission settings, you can only specifypermissionSettingsfield masks; you cannot update other field masks at the same time.permissionSettingsis not supported withuseAdminAccess. The supported field masks include:permission_settings.manageMembersAndGroupspermission_settings.modifySpaceDetailspermission_settings.toggleHistorypermission_settings.useAtMentionAllpermission_settings.manageAppspermission_settings.manageWebhookspermission_settings.replyMessages
-
use_admin_access (::Boolean) — Optional. When
true, the method runs using the user's Google Workspace administrator privileges.The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege.
Requires the
chat.admin.spacesOAuth 2.0 scope.Some
FieldMaskvalues are not supported using admin access. For details, see the description ofupdate_mask.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::Space)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::UpdateSpaceRequest.new # Call the update_space method. result = client.update_space request # The returned object is of type Google::Apps::Chat::V1::Space. p result
#update_space_notification_setting
def update_space_notification_setting(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSetting
def update_space_notification_setting(space_notification_setting: nil, update_mask: nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSettingUpdates the space notification setting. For an example, see Update the caller's space notification setting.
Requires user authentication with the authorization scope:
def update_space_notification_setting(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSettingupdate_space_notification_setting via a request object, either of type
UpdateSpaceNotificationSettingRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_space_notification_setting(space_notification_setting: nil, update_mask: nil) -> ::Google::Apps::Chat::V1::SpaceNotificationSettingupdate_space_notification_setting via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
space_notification_setting (::Google::Apps::Chat::V1::SpaceNotificationSetting, ::Hash) — Required. The resource name for the space notification settings must be
populated in the form of
users/{user}/spaces/{space}/spaceNotificationSetting. Only fields specified byupdate_maskare updated. -
update_mask (::Google::Protobuf::FieldMask, ::Hash) —
Required. Supported field paths:
notification_settingmute_setting
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::SpaceNotificationSetting)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new # Call the update_space_notification_setting method. result = client.update_space_notification_setting request # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. p result
#update_space_read_state
def update_space_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceReadState
def update_space_read_state(space_read_state: nil, update_mask: nil) -> ::Google::Apps::Chat::V1::SpaceReadStateUpdates 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 with the authorization scope:
def update_space_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceReadStateupdate_space_read_state via a request object, either of type
UpdateSpaceReadStateRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_space_read_state(space_read_state: nil, update_mask: nil) -> ::Google::Apps::Chat::V1::SpaceReadStateupdate_space_read_state via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
space_read_state (::Google::Apps::Chat::V1::SpaceReadState, ::Hash) — Required. The space read state and fields to update.
Only supports updating read state for the calling user.
To refer to the calling user, set one of the following:
The
mealias. For example,users/me/spaces/{space}/spaceReadState.Their Workspace email address. For example,
users/user@example.com/spaces/{space}/spaceReadState.Their user id. For example,
users/123456789/spaces/{space}/spaceReadState.
Format: users/{user}/spaces/{space}/spaceReadState
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The field paths to update. Currently supported field paths:
last_read_time
When the
last_read_timeis before the latest message create time, the space appears as unread in the UI.To mark the space as read, set
last_read_timeto any value later (larger) than the latest message create time. Thelast_read_timeis coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::SpaceReadState)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new # Call the update_space_read_state method. result = client.update_space_read_state request # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. p result
#upload_attachment
def upload_attachment(request, options = nil) -> ::Google::Apps::Chat::V1::UploadAttachmentResponse
def upload_attachment(parent: nil, filename: nil) -> ::Google::Apps::Chat::V1::UploadAttachmentResponseUploads an attachment. For an example, see Upload media as a file attachment.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.createhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.
def upload_attachment(request, options = nil) -> ::Google::Apps::Chat::V1::UploadAttachmentResponseupload_attachment via a request object, either of type
UploadAttachmentRequest or an equivalent Hash.
- request (::Google::Apps::Chat::V1::UploadAttachmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def upload_attachment(parent: nil, filename: nil) -> ::Google::Apps::Chat::V1::UploadAttachmentResponseupload_attachment via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}".
- filename (::String) — Required. The filename of the attachment, including the file extension.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Apps::Chat::V1::UploadAttachmentResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/apps/chat/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Apps::Chat::V1::ChatService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Apps::Chat::V1::UploadAttachmentRequest.new # Call the upload_attachment method. result = client.upload_attachment request # The returned object is of type Google::Apps::Chat::V1::UploadAttachmentResponse. p result