Google Chat V1 API - Class Google::Apps::Chat::V1::ChatService::Client (v0.4.0)

Reference documentation and code samples for the Google Chat V1 API class Google::Apps::Chat::V1::ChatService::Client.

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

Configure the ChatService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all ChatService clients
::Google::Apps::Chat::V1::ChatService::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::CompleteImportSpaceResponse

Completes the import process for the specified space and makes it visible to users. Requires app authentication and domain-wide delegation. For more information, see Authorize Google Chat apps to import data.

Overloads
def complete_import_space(request, options = nil) -> ::Google::Apps::Chat::V1::CompleteImportSpaceResponse
Pass arguments to complete_import_space via a request object, either of type Google::Apps::Chat::V1::CompleteImportSpaceRequest or an equivalent Hash.
Parameters
  • 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::CompleteImportSpaceResponse
Pass arguments to complete_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).
Parameter
  • name (::String) — Required. Resource name of the import mode space.

    Format: spaces/{space}

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

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

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_membership

def create_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def create_membership(parent: nil, membership: nil) -> ::Google::Apps::Chat::V1::Membership

Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see Invite or add a user or a Google Chat app to a space. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires user authentication.

To specify the member to add, set the membership.member.name for the human or app member, or set the membership.group_member.name for the group member.

  • To add the calling app to a space or a direct message between two human users, use users/app. Unable to add other apps to the space.

  • 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 add or invite a Google group in a named space, 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 or invite the group to a named 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.

Overloads
def create_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to create_membership via a request object, either of type Google::Apps::Chat::V1::CreateMembershipRequest or an equivalent Hash.
Parameters
  • 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) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to create_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).
Parameters
  • 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 memberType field must contain a user with the user.name and user.type fields populated. The server will assign a resource name and overwrite anything specified. When a Chat app creates a membership relation for a human user, it must use the chat.memberships scope, set user.type to HUMAN, and set user.name with format users/{user}, where {user} can be the email address for the user. For users in the same Workspace organization {user} can also be the id of the person from the People API, or the id for the user in the Directory API. For example, if the People API Person profile ID for user@example.com is 123456789, you can add the user to the space by setting the membership.member.name to users/user@example.com or users/123456789. When a Chat app creates a membership relation for itself, it must use the chat.memberships.app scope, set user.type to BOT, and set user.name to users/app.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Creates a message in a Google Chat space. The maximum message size, including text and cards, is 32,000 bytes. For an example, see Send a message.

Calling this method requires authentication and supports the following authentication types:

  • For text messages, user authentication or app authentication are supported.
  • For card messages, only app authentication is supported. (Only Chat apps can create card messages.)
Overloads
def create_message(request, options = nil) -> ::Google::Apps::Chat::V1::Message
Pass arguments to create_message via a request object, either of type Google::Apps::Chat::V1::CreateMessageRequest or an equivalent Hash.
Parameters
  • 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::Message
Pass arguments to create_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).
Parameters
  • 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 threadKey or 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.
  • 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 name field).

    The value for this field must meet the following requirements:

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

    For details, see Name a message.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Creates a reaction and adds it to a message. Only unicode emojis are supported. For an example, see Add a reaction to a message. Requires user authentication.

Overloads
def create_reaction(request, options = nil) -> ::Google::Apps::Chat::V1::Reaction
Pass arguments to create_reaction via a request object, either of type Google::Apps::Chat::V1::CreateReactionRequest or an equivalent Hash.
Parameters
  • 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::Reaction
Pass arguments to create_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).
Parameters
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Creates a named space. Spaces grouped by topics aren't supported. For an example, see Create a space.

If you receive the error message ALREADY_EXISTS when creating a space, try a different displayName. An existing space within the Google Workspace organization might already use this display name.

Requires user authentication.

Overloads
def create_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
Pass arguments to create_space via a request object, either of type Google::Apps::Chat::V1::CreateSpaceRequest or an equivalent Hash.
Parameters
  • 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::Space
Pass arguments to create_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).
Parameters
  • space (::Google::Apps::Chat::V1::Space, ::Hash) — Required. The displayName and spaceType fields must be populated. Only SpaceType.SPACE is supported.

    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.

    The space name is 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

def delete_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def delete_membership(name: nil) -> ::Google::Apps::Chat::V1::Membership

Deletes a membership. For an example, see Remove a user or a Google Chat app from a space.

Requires user authentication.

Overloads
def delete_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to delete_membership via a request object, either of type DeleteMembershipRequest or an equivalent Hash.
Parameters
  • 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) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to delete_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).
Parameter
  • 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.memberships scope and spaces/{space}/members/{member} format. You can use the email as an alias for {member}. For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

    When deleting an app membership, requires the chat.memberships.app scope and spaces/{space}/members/app format.

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

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

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

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

Overloads
def delete_message(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_message via a request object, either of type DeleteMessageRequest or an equivalent Hash.
Parameters
  • 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::Empty
Pass arguments to delete_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).
Parameters
  • 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 clientAssignedMessageId field for {message}. For details, see Name a message.

  • force (::Boolean) — When true, deleting a message also deletes its threaded replies. When false, if a message has threaded replies, deletion fails.

    Only applies when authenticating as a user. Has no effect when authenticating as a Chat app.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Deletes a reaction to a message. Only unicode emojis are supported. For an example, see Delete a reaction. Requires user authentication.

Overloads
def delete_reaction(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_reaction via a request object, either of type DeleteReactionRequest or an equivalent Hash.
Parameters
  • 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::Empty
Pass arguments to delete_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).
Parameter
  • name (::String) — Required. Name of the reaction to delete.

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

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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) -> ::Google::Protobuf::Empty

Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see Delete a space. Requires user authentication from a user who has permission to delete the space.

Overloads
def delete_space(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_space via a request object, either of type DeleteSpaceRequest or an equivalent Hash.
Parameters
  • 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) -> ::Google::Protobuf::Empty
Pass arguments to delete_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).
Parameter
  • name (::String) — Required. Resource name of the space to delete.

    Format: spaces/{space}

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Returns the existing direct message with the specified user. If no direct message space is found, returns a 404 NOT_FOUND error. For an example, see Find a direct message.

With user authentication, returns the direct message space between the specified user and the authenticated user.

With app authentication, returns the direct message space between the specified user and the calling Chat app.

Requires user authentication or app authentication.

Overloads
def find_direct_message(request, options = nil) -> ::Google::Apps::Chat::V1::Space
Pass arguments to find_direct_message via a request object, either of type FindDirectMessageRequest or an equivalent Hash.
Parameters
  • 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::Space
Pass arguments to find_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).
Parameter
  • name (::String) — Required. Resource name of the user to find direct message with.

    Format: users/{user}, where {user} is either 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 profile ID is 123456789, you can find a direct message with that person by using users/123456789 as the name. When authenticated as a user, you can use the email as an alias for {user}. For example, users/example@gmail.com where example@gmail.com is the email of the Google Chat user.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Gets the metadata of a message attachment. The attachment data is fetched using the media API. For an example, see Get metadata about a message attachment. Requires app authentication.

Overloads
def get_attachment(request, options = nil) -> ::Google::Apps::Chat::V1::Attachment
Pass arguments to get_attachment via a request object, either of type GetAttachmentRequest or an equivalent Hash.
Parameters
  • 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::Attachment
Pass arguments to get_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).
Parameter
  • name (::String) — Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

def get_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def get_membership(name: nil) -> ::Google::Apps::Chat::V1::Membership

Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership.

Requires authentication. Supports app authentication and user authentication.

Overloads
def get_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to get_membership via a request object, either of type GetMembershipRequest or an equivalent Hash.
Parameters
  • 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) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to get_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).
Parameter
  • 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} or spaces/{space}/members/app

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

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

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

Requires authentication. Supports app authentication and user authentication.

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

Overloads
def get_message(request, options = nil) -> ::Google::Apps::Chat::V1::Message
Pass arguments to get_message via a request object, either of type GetMessageRequest or an equivalent Hash.
Parameters
  • 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::Message
Pass arguments to get_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).
Parameter
  • 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 clientAssignedMessageId field for {message}. For details, see Name a message.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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) -> ::Google::Apps::Chat::V1::Space

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

Requires authentication. Supports app authentication and user authentication.

Overloads
def get_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
Pass arguments to get_space via a request object, either of type GetSpaceRequest or an equivalent Hash.
Parameters
  • 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) -> ::Google::Apps::Chat::V1::Space
Pass arguments to get_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).
Parameter
  • name (::String) — Required. Resource name of the space, in the form spaces/{space}.

    Format: spaces/{space}

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Returns an event from a Google Chat space. The event payload contains the most recent version of the resource that changed. For example, if you request an event about a new message but the message was later updated, the server returns the updated Message resource in the event payload.

Requires user authentication. To get an event, the authenticated user must be a member of the space.

For an example, see Get details about an event from a Google Chat space.

Overloads
def get_space_event(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceEvent
Pass arguments to get_space_event via a request object, either of type GetSpaceEventRequest or an equivalent Hash.
Parameters
  • 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::SpaceEvent
Pass arguments to get_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).
Parameter
  • name (::String) — Required. The resource name of the space event.

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

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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_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::SpaceReadState

Returns details about a user's read state within a space, used to identify read and unread messages. For an example, see Get details about a user's space read state.

Requires user authentication.

Overloads
def get_space_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceReadState
Pass arguments to get_space_read_state via a request object, either of type GetSpaceReadStateRequest or an equivalent Hash.
Parameters
  • 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::SpaceReadState
Pass arguments to get_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).
Parameter
  • 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 me alias. For example, users/me/spaces/{space}/spaceReadState.

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

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

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

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Returns details about a user's read state within a thread, used to identify read and unread messages. For an example, see Get details about a user's thread read state.

Requires user authentication.

Overloads
def get_thread_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::ThreadReadState
Pass arguments to get_thread_read_state via a request object, either of type GetThreadReadStateRequest or an equivalent Hash.
Parameters
  • 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::ThreadReadState
Pass arguments to get_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).
Parameter
  • 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 me alias. For example, users/me/spaces/{space}/threads/{thread}/threadReadState.

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

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

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

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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| ... } -> Client

Create a new ChatService client object.

Yields
  • (config) — Configure the ChatService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Apps::Chat::V1::ChatService::Client.new

# Create a client using a custom configuration
client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config|
  config.timeout = 10.0
end

#list_memberships

def list_memberships(request, options = nil) -> ::Gapic::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) -> ::Gapic::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.

Requires authentication. Supports app authentication and user authentication.

Overloads
def list_memberships(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership>
Pass arguments to list_memberships via a request object, either of type ListMembershipsRequest or an equivalent Hash.
Parameters
  • 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) -> ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership>
Pass arguments to 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).
Parameters
  • 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_ARGUMENT error.

  • 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 role to ROLE_MEMBER or ROLE_MANAGER.

    To filter by type, set member.type to HUMAN or BOT. Developer Preview: You can also filter for member.type using the != operator.

    To filter by both role and type, use the AND operator. To filter by either role or type, use the OR operator.

    Either member.type = "HUMAN" or member.type != "BOT" is required when use_admin_access is 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_ARGUMENT error.

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

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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::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::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. For an example, see List messages. Requires user authentication.

Overloads
def list_messages(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Message>
Pass arguments to list_messages via a request object, either of type ListMessagesRequest or an equivalent Hash.
Parameters
  • 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::PagedEnumerable<::Google::Apps::Chat::V1::Message>
Pass arguments to 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).
Parameters
  • parent (::String) — Required. The resource name of the space to list messages from.

    Format: spaces/{space}

  • page_size (::Integer) — 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_ARGUMENT error.

  • page_token (::String) — Optional, if resuming from a previous query.

    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) — 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_time with 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 the AND operator between two timestamps.

    To filter by thread, specify the thread.name, formatted as spaces/{space}/threads/{thread}. You can only specify one thread.name per query.

    To filter by both thread and date, use the AND operator 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_ARGUMENT error.

  • order_by (::String) — Optional, if resuming from a previous query.

    How the list of messages is ordered. Specify a value to order by an ordering operation. Valid ordering operation values are as follows:

    • ASC for ascending.

    • DESC for descending.

    The default ordering is create_time ASC.

  • show_deleted (::Boolean) — Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>
def list_reactions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>

Lists reactions to a message. For an example, see List reactions for a message. Requires user authentication.

Overloads
def list_reactions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>
Pass arguments to list_reactions via a request object, either of type ListReactionsRequest or an equivalent Hash.
Parameters
  • 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::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>
Pass arguments to 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).
Parameters
  • 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.unicode or emoji.custom_emoji.uid) and user (user.name).

    To filter reactions for multiple emojis or users, join similar fields with the OR operator, such as emoji.unicode = "🙂" OR emoji.unicode = "👍" and user.name = "users/AAAAAA" OR user.name = "users/BBBBBB".

    To filter reactions by emoji and user, use the AND operator, such as emoji.unicode = "🙂" AND user.name = "users/AAAAAA".

    If your query uses both AND and OR, 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 by the server with an INVALID_ARGUMENT error.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>
def list_space_events(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::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. To list events, the authenticated user must be a member of the space.

For an example, see List events from a Google Chat space.

Overloads
def list_space_events(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>
Pass arguments to list_space_events via a request object, either of type ListSpaceEventsRequest or an equivalent Hash.
Parameters
  • 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::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>
Pass arguments to 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).
Parameters
  • 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_ARGUMENT error.

  • page_token (::String) — 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 the OR operator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions (google.workspace.chat.reaction.v1.created), the server also returns batch new reactions events (google.workspace.chat.reaction.v1.batchCreated). For a list of supported event types, see the SpaceEvents reference documentation.

    Optionally, you can also filter by start time (start_time) and end time (end_time):

    • start_time: Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.
    • end_time: Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.

    To specify a start or end time, use the equals = operator and format in RFC-3339. To filter by both start_time and end_time, use the AND operator.

    For example, the following queries are valid:

    start_time="2023-08-23T19:20:33+00:00" AND end_time="2023-08-23T19:21:54+00:00" start_time="2023-08-23T19:20:33+00:00" AND (event_types:"google.workspace.chat.space.v1.updated" OR event_types:"google.workspace.chat.message.v1.created")

    The following queries are invalid:

    start_time="2023-08-23T19:20:33+00:00" OR end_time="2023-08-23T19:21:54+00:00" event_types:"google.workspace.chat.space.v1.updated" AND event_types:"google.workspace.chat.message.v1.created"

    Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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::PagedEnumerable<::Google::Apps::Chat::V1::Space>
def list_spaces(page_size: nil, page_token: nil, filter: nil) -> ::Gapic::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.

Requires authentication. Supports app authentication and user authentication.

Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.

To list all named spaces by Google Workspace organization, use the spaces.search() method using Workspace administrator privileges instead.

Overloads
def list_spaces(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Pass arguments to list_spaces via a request object, either of type ListSpacesRequest or an equivalent Hash.
Parameters
  • 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::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Pass arguments to 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).
Parameters
  • 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_ARGUMENT error.

  • 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 SPACE or GROUP_CHAT (the space_type can't be SPACE_TYPE_UNSPECIFIED). To query for multiple space types, use the OR operator.

    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_ARGUMENT error.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

#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::Space

Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see Set up a space with initial members.

To specify the human members to add, add memberships with the appropriate membership.member.name. To add a human user, use users/{user}, where {user} can be the email address for the user. For users in the same Workspace organization {user} can also be the id for the person from the People API, or the id for the user in the Directory API. For example, if the People API Person profile ID for user@example.com is 123456789, you can add the user to the space by setting the membership.member.name to users/user@example.com or users/123456789.

To specify the Google groups to add, add memberships with the appropriate membership.group_member.name. To add or invite a Google group, use groups/{group}, where {group} is the id for the group from the Cloud Identity Groups API. For example, you can use Cloud Identity Groups lookup API to retrieve the ID 123456789 for group email group@example.com, then you can add the group to the space by setting the membership.group_member.name to groups/123456789. Group email is not supported, and Google groups can only be added as members in named spaces.

For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space.

To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created.

To create a DM between the calling user and the calling app, set Space.singleUserBotDm to true and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see Invite or add a user or app to a space.

If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned.

Spaces with threaded replies aren't supported. If you receive the error message ALREADY_EXISTS when setting up a space, try a different displayName. An existing space within the Google Workspace organization might already use this display name.

Requires user authentication.

Overloads
def set_up_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
Pass arguments to set_up_space via a request object, either of type SetUpSpaceRequest or an equivalent Hash.
Parameters
  • 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::Space
Pass arguments to set_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).
Parameters
  • space (::Google::Apps::Chat::V1::Space, ::Hash) — Required. The Space.spaceType field is required.

    To create a space, set Space.spaceType to SPACE and set Space.displayName. 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.

    To create a group chat, set Space.spaceType to GROUP_CHAT. Don't set Space.displayName.

    To create a 1:1 conversation between humans, set Space.spaceType to DIRECT_MESSAGE and set Space.singleUserBotDm to false. Don't set Space.displayName or Space.spaceDetails.

    To create an 1:1 conversation between a human and the calling Chat app, set Space.spaceType to DIRECT_MESSAGE and Space.singleUserBotDm to true. Don't set Space.displayName or Space.spaceDetails.

    If a DIRECT_MESSAGE space 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 20 memberships (in addition to the caller).

    For human membership, the Membership.member field must contain a user with name populated (format: users/{user}) and type set to User.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, the user.name can be users/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_member field must contain a group with name populated (format groups/{group}). You can only add Google groups when setting Space.spaceType to SPACE.

    Optional when setting Space.spaceType to SPACE.

    Required when setting Space.spaceType to GROUP_CHAT, along with at least two memberships.

    Required when setting Space.spaceType to DIRECT_MESSAGE with 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.spaceType to DIRECT_MESSAGE and Space.singleUserBotDm to true).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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() -> String

The effective universe domain

Returns
  • (String)

#update_membership

def update_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
def update_membership(membership: nil, update_mask: nil) -> ::Google::Apps::Chat::V1::Membership

Updates a membership. For an example, see Update a user's membership in a space.

Requires user authentication.

Overloads
def update_membership(request, options = nil) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to update_membership via a request object, either of type UpdateMembershipRequest or an equivalent Hash.
Parameters
  • 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) -> ::Google::Apps::Chat::V1::Membership
Pass arguments to update_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).
Parameters
  • membership (::Google::Apps::Chat::V1::Membership, ::Hash) — Required. The membership to update. Only fields specified by update_mask are 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
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Updates a message. There's a difference between the patch and update methods. The patch method uses a patch request while the update method uses a put request. We recommend using the patch method. For an example, see Update a message.

Requires authentication. Supports app authentication and user authentication. When using app authentication, requests can only update messages created by the calling Chat app.

Overloads
def update_message(request, options = nil) -> ::Google::Apps::Chat::V1::Message
Pass arguments to update_message via a request object, either of type UpdateMessageRequest or an equivalent Hash.
Parameters
  • 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::Message
Pass arguments to update_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).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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) -> ::Google::Apps::Chat::V1::Space

Updates a space. For an example, see Update a space.

If you're updating the displayName field and receive the error message ALREADY_EXISTS, try a different display name.. An existing space within the Google Workspace organization might already use this display name.

Requires user authentication.

Overloads
def update_space(request, options = nil) -> ::Google::Apps::Chat::V1::Space
Pass arguments to update_space via a request object, either of type UpdateSpaceRequest or an equivalent Hash.
Parameters
  • 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) -> ::Google::Apps::Chat::V1::Space
Pass arguments to update_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).
Parameters
  • space (::Google::Apps::Chat::V1::Space, ::Hash) — Required. Space with fields to be updated. Space.name must be populated in the form of spaces/{space}. Only fields specified by update_mask are updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) —

    Required. The updated field paths, comma separated if there are multiple.

    Currently supported field paths:

    • display_name (Only supports changing the display name of a space with the SPACE type, or when also including the space_type mask to change a GROUP_CHAT space type to SPACE. Trying to update the display name of a GROUP_CHAT or a DIRECT_MESSAGE space results in an invalid argument error. If you receive the error message ALREADY_EXISTS when updating the displayName, try a different displayName. An existing space within the Google Workspace organization might already use this display name.)

    • space_type (Only supports changing a GROUP_CHAT space type to SPACE. Include display_name together with space_type in the update mask and ensure that the specified space has a non-empty display name and the SPACE space type. Including the space_type mask and the SPACE type in the specified space when updating the display name is optional if the existing space already has the SPACE type. Trying to update the space type in other ways results in an invalid argument error). space_type is not supported with admin access.

    • space_details

    • space_history_state (Supports turning history on or off for the space if the organization allows users to change their history setting. Warning: mutually exclusive with all other field paths.) space_history_state is not supported with admin access.

    • access_settings.audience (Supports changing the access setting of who can discover the space, join the space, and preview the messages in space. If no audience is specified in the access setting, the space's access setting is updated to private. Warning: mutually exclusive with all other field paths.) access_settings.audience is not supported with admin access.

    • Developer Preview: Supports changing the permission settings of a space, supported field paths include: permission_settings.manage_members_and_groups, permission_settings.modify_space_details, permission_settings.toggle_history, permission_settings.use_at_mention_all, permission_settings.manage_apps, permission_settings.manage_webhooks, permission_settings.reply_messages (Warning: mutually exclusive with all other non-permission settings field paths). permission_settings is not supported with admin access.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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_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::SpaceReadState

Updates a user's read state within a space, used to identify read and unread messages. For an example, see Update a user's space read state.

Requires user authentication.

Overloads
def update_space_read_state(request, options = nil) -> ::Google::Apps::Chat::V1::SpaceReadState
Pass arguments to update_space_read_state via a request object, either of type UpdateSpaceReadStateRequest or an equivalent Hash.
Parameters
  • 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::SpaceReadState
Pass arguments to update_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).
Parameters
  • 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 me alias. For example, users/me/spaces/{space}/spaceReadState.

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

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

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

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The field paths to update. Currently supported field paths:

    • last_read_time

    When the last_read_time is before the latest message create time, the space appears as unread in the UI.

    To mark the space as read, set last_read_time to any value later (larger) than the latest message create time. The last_read_time is coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

Uploads an attachment. For an example, see Upload media as a file attachment. Requires user authentication.

You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.

Overloads
def upload_attachment(request, options = nil) -> ::Google::Apps::Chat::V1::UploadAttachmentResponse
Pass arguments to upload_attachment via a request object, either of type UploadAttachmentRequest or an equivalent Hash.
Parameters
  • 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::UploadAttachmentResponse
Pass arguments to upload_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).
Parameters
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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