Class: Google::Apis::ChatV1::HangoutsChatService

Inherits:
Google::Apis::Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/chat_v1/service.rb

Overview

Google Chat API

The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages.

Examples:

require 'google/apis/chat_v1'

Chat = Google::Apis::ChatV1 # Alias the module
service = Chat::HangoutsChatService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://chat.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHangoutsChatService

Returns a new instance of HangoutsChatService.



48
49
50
51
52
53
# File 'lib/google/apis/chat_v1/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-chat_v1',
        client_version: Google::Apis::ChatV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



41
42
43
# File 'lib/google/apis/chat_v1/service.rb', line 41

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



46
47
48
# File 'lib/google/apis/chat_v1/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#complete_import_space(name, complete_import_space_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::CompleteImportSpaceResponse

Completes the import process for the specified space and makes it visible to users. Requires user authentication and domain-wide delegation with the authorization scope: - https://www.googleapis.com/auth/chat.import For more information, see Authorize Google Chat apps to import data.

Parameters:

  • name (String)

    Required. Resource name of the import mode space. Format: spaces/space``

  • complete_import_space_request_object (Google::Apis::ChatV1::CompleteImportSpaceRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



356
357
358
359
360
361
362
363
364
365
366
# File 'lib/google/apis/chat_v1/service.rb', line 356

def complete_import_space(name, complete_import_space_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:completeImport', options)
  command.request_representation = Google::Apis::ChatV1::CompleteImportSpaceRequest::Representation
  command.request_object = complete_import_space_request_object
  command.response_representation = Google::Apis::ChatV1::CompleteImportSpaceResponse::Representation
  command.response_class = Google::Apis::ChatV1::CompleteImportSpaceResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_custom_emoji(custom_emoji_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::CustomEmoji

Creates a custom emoji. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions. Requires user authentication with the authorization scope: - https://www. googleapis.com/auth/chat.customemojis

Parameters:

  • custom_emoji_object (Google::Apis::ChatV1::CustomEmoji) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



82
83
84
85
86
87
88
89
90
91
# File 'lib/google/apis/chat_v1/service.rb', line 82

def create_custom_emoji(custom_emoji_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/customEmojis', options)
  command.request_representation = Google::Apis::ChatV1::CustomEmoji::Representation
  command.request_object = custom_emoji_object
  command.response_representation = Google::Apis::ChatV1::CustomEmoji::Representation
  command.response_class = Google::Apis::ChatV1::CustomEmoji
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_space(space_object = nil, request_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space

Creates 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: - https://www.googleapis.com/auth/chat.app.spaces.create - https:// www.googleapis.com/auth/chat.app.spaces - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.spaces.create - https://www.googleapis.com/auth/chat.spaces - https:// www.googleapis.com/auth/chat.import (import mode spaces only) 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.

Parameters:

  • space_object (Google::Apis::ChatV1::Space) (defaults to: nil)
  • request_id (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



417
418
419
420
421
422
423
424
425
426
427
# File 'lib/google/apis/chat_v1/service.rb', line 417

def create_space(space_object = nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/spaces', options)
  command.request_representation = Google::Apis::ChatV1::Space::Representation
  command.request_object = space_object
  command.response_representation = Google::Apis::ChatV1::Space::Representation
  command.response_class = Google::Apis::ChatV1::Space
  command.query['requestId'] = request_id unless request_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_space_member(parent, membership_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership

Creates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Supports the following types of authentication: - App authentication with administrator approval and the authorization scope: - https://www.googleapis.com/auth/chat.app. memberships - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.memberships - https://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_access is true, and the following authorization scope is used: - https://www.googleapis.com/auth/chat.admin. memberships 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: - Invite or add a user to a space. - Invite or add a Google Group to a space. - Add the Chat app to a space.

Parameters:

  • parent (String)

    Required. The resource name of the space for which to create the membership. Format: spaces/space

  • membership_object (Google::Apis::ChatV1::Membership) (defaults to: nil)
  • use_admin_access (Boolean) (defaults to: nil)

    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.memberships OAuth 2.0 scope. Creating app memberships or creating memberships for users outside the administrator's Google Workspace organization isn't supported using admin access.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
# File 'lib/google/apis/chat_v1/service.rb', line 1088

def create_space_member(parent, membership_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/members', options)
  command.request_representation = Google::Apis::ChatV1::Membership::Representation
  command.request_object = membership_object
  command.response_representation = Google::Apis::ChatV1::Membership::Representation
  command.response_class = Google::Apis::ChatV1::Membership
  command.params['parent'] = parent unless parent.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_space_message(parent, message_object = nil, create_message_notification_options_notification_type: nil, message_id: nil, message_reply_option: nil, request_id: nil, thread_key: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Creates 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: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/ auth/chat.messages.create - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) Chat attributes the message sender differently depending on the type of authentication that you use in your request. The following image shows how Chat attributes a message when you use app authentication. Chat displays the Chat app as the message sender. The content of the message can contain text ( text), cards (cardsV2), and accessory widgets (accessoryWidgets). 
Message sent with app authentication The following image shows how Chat attributes a message when you use user authentication. Chat displays the user as the message sender and attributes the Chat app to the message by displaying its name. The content of message can only contain text (text). Message
sent with user authentication The maximum message size, including the message contents, is 32,000 bytes. For webhook requests, the response doesn't contain the full message. The response only populates the name and thread.name fields in addition to the information that was in the request.

Parameters:

  • parent (String)

    Required. The resource name of the space in which to create a message. Format: spaces/space``

  • message_object (Google::Apis::ChatV1::Message) (defaults to: nil)
  • create_message_notification_options_notification_type (String) (defaults to: nil)

    The notification type for the message.

  • message_id (String) (defaults to: nil)

    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.
  • message_reply_option (String) (defaults to: nil)

    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.

  • request_id (String) (defaults to: nil)

    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.

  • thread_key (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
# File 'lib/google/apis/chat_v1/service.rb', line 1471

def create_space_message(parent, message_object = nil, create_message_notification_options_notification_type: nil, message_id: nil, message_reply_option: nil, request_id: nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/messages', options)
  command.request_representation = Google::Apis::ChatV1::Message::Representation
  command.request_object = message_object
  command.response_representation = Google::Apis::ChatV1::Message::Representation
  command.response_class = Google::Apis::ChatV1::Message
  command.params['parent'] = parent unless parent.nil?
  command.query['createMessageNotificationOptions.notificationType'] = create_message_notification_options_notification_type unless create_message_notification_options_notification_type.nil?
  command.query['messageId'] = message_id unless message_id.nil?
  command.query['messageReplyOption'] = message_reply_option unless message_reply_option.nil?
  command.query['requestId'] = request_id unless request_id.nil?
  command.query['threadKey'] = thread_key unless thread_key.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_space_message_reaction(parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Reaction

Creates 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: - https://www.googleapis.com/auth/ chat.messages.reactions.create - https://www.googleapis.com/auth/chat. messages.reactions - https://www.googleapis.com/auth/chat.messages - https: //www.googleapis.com/auth/chat.import (import mode spaces only)

Parameters:

  • parent (String)

    Required. The message where the reaction is created. Format: spaces/space/ messages/message``

  • reaction_object (Google::Apis::ChatV1::Reaction) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
# File 'lib/google/apis/chat_v1/service.rb', line 1885

def create_space_message_reaction(parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/reactions', options)
  command.request_representation = Google::Apis::ChatV1::Reaction::Representation
  command.request_object = reaction_object
  command.response_representation = Google::Apis::ChatV1::Reaction::Representation
  command.response_class = Google::Apis::ChatV1::Reaction
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_section(parent, google_chat_v1_section_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::GoogleChatV1Section

Creates a section in Google Chat. Sections help users group conversations and customize the list of spaces displayed in Chat navigation panel. Only sections of type CUSTOM_SECTION can be created. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/chat.users.sections

Parameters:

  • parent (String)

    Required. The parent resource name where the section is created. Format: users/user``

  • google_chat_v1_section_object (Google::Apis::ChatV1::GoogleChatV1Section) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
# File 'lib/google/apis/chat_v1/service.rb', line 2413

def create_user_section(parent, google_chat_v1_section_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/sections', options)
  command.request_representation = Google::Apis::ChatV1::GoogleChatV1Section::Representation
  command.request_object = google_chat_v1_section_object
  command.response_representation = Google::Apis::ChatV1::GoogleChatV1Section::Representation
  command.response_class = Google::Apis::ChatV1::GoogleChatV1Section
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_custom_emoji(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty

Deletes a custom emoji. By default, users can only delete custom emoji they created. Emoji managers assigned by the administrator can delete any custom emoji in the organization. See Learn about custom emojis in Google Chat. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions. Requires user authentication with the authorization scope: - https://www. googleapis.com/auth/chat.customemojis

Parameters:

  • name (String)

    Required. Resource name of the custom emoji to delete. Format: customEmojis/ customEmojiYou can use the emoji name as an alias forcustomEmoji`. For example,customEmojis/:example-emoji:where:example-emoji:` is the emoji name for a custom emoji.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



128
129
130
131
132
133
134
135
136
# File 'lib/google/apis/chat_v1/service.rb', line 128

def delete_custom_emoji(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Empty::Representation
  command.response_class = Google::Apis::ChatV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_space(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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. 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.delete - https://www. googleapis.com/auth/chat.import (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, use_admin_access is true, and the following authorization scope is used: - https://www.googleapis.com/auth/chat.admin.delete

Parameters:

  • name (String)

    Required. Resource name of the space to delete. Format: spaces/space``

  • use_admin_access (Boolean) (defaults to: nil)

    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.delete OAuth 2.0 scope.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



471
472
473
474
475
476
477
478
479
480
# File 'lib/google/apis/chat_v1/service.rb', line 471

def delete_space(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Empty::Representation
  command.response_class = Google::Apis::ChatV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_space_member(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership

Deletes a membership. For an example, see Remove a user or a Google Chat app from a space. Supports the following types of authentication: - App authentication with administrator approval and the authorization scope: - https://www.googleapis.com/auth/chat.app.memberships - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.memberships - https://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_access is true, and the following authorization scope is used: - https://www.googleapis.com/auth/chat. admin.memberships 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.

Parameters:

  • 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 with user authentication or the chat.memberships.app scope with app authentication and the spaces/space/members/memberformat. You can use the email as an alias formember. 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.

  • use_admin_access (Boolean) (defaults to: nil)

    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.memberships OAuth 2.0 scope. Deleting app memberships in a space isn't supported using admin access.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
# File 'lib/google/apis/chat_v1/service.rb', line 1160

def delete_space_member(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Membership::Representation
  command.response_class = Google::Apis::ChatV1::Membership
  command.params['name'] = name unless name.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_space_message(name, force: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty

Deletes a message. For an example, see Delete a message. Supports the following types of authentication: - App authentication with the authorization scope: - https:// www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat. messages - https://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.

Parameters:

  • name (String)

    Required. Resource name of the message. Format: spaces/space/messages/ messageIf you've set a custom ID for your message, you can use the value from the `clientAssignedMessageId` field formessage``. For details, see Name a message.

  • force (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
# File 'lib/google/apis/chat_v1/service.rb', line 1529

def delete_space_message(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Empty::Representation
  command.response_class = Google::Apis::ChatV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['force'] = force unless force.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_space_message_reaction(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty

Deletes a reaction to a message. For an example, see Delete a reaction. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.reactions - https://www. googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat. import (import mode spaces only)

Parameters:

  • name (String)

    Required. Name of the reaction to delete. Format: spaces/space/messages/ message/reactions/reaction``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1925
1926
1927
1928
1929
1930
1931
1932
1933
# File 'lib/google/apis/chat_v1/service.rb', line 1925

def delete_space_message_reaction(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Empty::Representation
  command.response_class = Google::Apis::ChatV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_section(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty

Deletes a section of type CUSTOM_SECTION. If the section contains items, such as spaces, the items are moved to Google Chat's default sections and are not deleted. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope: - https://www. googleapis.com/auth/chat.users.sections

Parameters:

  • name (String)

    Required. The name of the section to delete. Format: users/user/sections/ section``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2453
2454
2455
2456
2457
2458
2459
2460
2461
# File 'lib/google/apis/chat_v1/service.rb', line 2453

def delete_user_section(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Empty::Representation
  command.response_class = Google::Apis::ChatV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#download_medium(resource_name, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Media

Downloads media. Download is supported on the URI /v1/media/+name?alt=media .

Parameters:

  • resource_name (String)

    Name of the media that is being downloaded. See ReadRequest.resource_name.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • download_dest (IO, String) (defaults to: nil)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/google/apis/chat_v1/service.rb', line 259

def download_medium(resource_name, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
  if download_dest.nil?
    command = make_simple_command(:get, 'v1/media/{+resourceName}', options)
  else
    command = make_download_command(:get, 'v1/media/{+resourceName}', options)
    command.download_dest = download_dest
  end
  command.response_representation = Google::Apis::ChatV1::Media::Representation
  command.response_class = Google::Apis::ChatV1::Media
  command.params['resourceName'] = resource_name unless resource_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#find_space_direct_message(name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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 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: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https:/ /www.googleapis.com/auth/chat.spaces.readonly - https://www.googleapis.com/ auth/chat.spaces

Parameters:

  • name (String) (defaults to: nil)

    Required. Resource name of the user to find direct message with. Format: users/user, whereuseris either the `id` for the [person](https:// developers.google.com/people/api/rest/v1/people) from the People API, or the ` id` for the [user](https://developers.google.com/admin-sdk/directory/reference/ rest/v1/users) 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](https://developers. google.com/workspace/chat/authenticate-authorize-chat-user), you can use the email as an alias foruser`. For example,users/example@gmail.comwhere example@gmail.com` is the email of the Google Chat user.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



526
527
528
529
530
531
532
533
534
# File 'lib/google/apis/chat_v1/service.rb', line 526

def find_space_direct_message(name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/spaces:findDirectMessage', options)
  command.response_representation = Google::Apis::ChatV1::Space::Representation
  command.response_class = Google::Apis::ChatV1::Space
  command.query['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#find_space_group_chats(page_size: nil, page_token: nil, space_view: nil, users: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::FindGroupChatsResponse

Returns all spaces with spaceType == GROUP_CHAT, whose human memberships contain exactly the calling user, and the users specified in FindGroupChatsRequest.users. Only members that have joined the conversation are supported. For an example, see Find group chats. If the calling user blocks, or is blocked by, some users, and no spaces with the entire specified set of users are found, this method returns spaces that don't include the blocked or blocking users. The specified set of users must contain only human (non-app) memberships. A request that contains non-human users doesn't return any spaces. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.memberships.readonly

  • https://www.googleapis.com/auth/chat.memberships

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of spaces to return. The service might return fewer than this value. If unspecified, at most 10 spaces are returned. The maximum value is 30. If you use a value more than 30, it's automatically changed to 30. Negative values return an INVALID_ARGUMENT error.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous call to find group chats. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the token. Passing different values may lead to unexpected results.

  • space_view (String) (defaults to: nil)

    Requested space view type. If unset, defaults to SPACE_VIEW_RESOURCE_NAME_ONLY. Requests that specify SPACE_VIEW_EXPANDED must include scopes that allow reading space data, for example, https://www. googleapis.com/auth/chat.spaces or https://www.googleapis.com/auth/chat.spaces. readonly.

  • users (Array<String>, String) (defaults to: nil)

    Optional. Resource names of all human users in group chat with the calling user. Chat apps can't be included in the request. The maximum number of users that can be specified in a single request is 49. Format: users/user, whereuseris either the `id` for the [person](https://developers.google. com/people/api/rest/v1/people) from the People API, or the `id` for the [user]( https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, to find all group chats with the calling user and two other users, with People API profile IDs `123456789` and `987654321`, you can use `users/123456789` and `users/987654321`. You can also use the email as an alias foruser`. For example,users/example@gmail.comwhere example@gmail.com` is the email of the Google Chat user.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/google/apis/chat_v1/service.rb', line 595

def find_space_group_chats(page_size: nil, page_token: nil, space_view: nil, users: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/spaces:findGroupChats', options)
  command.response_representation = Google::Apis::ChatV1::FindGroupChatsResponse::Representation
  command.response_class = Google::Apis::ChatV1::FindGroupChatsResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['spaceView'] = space_view unless space_view.nil?
  command.query['users'] = users unless users.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_custom_emoji(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::CustomEmoji

Returns details about a custom emoji. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.customemojis. readonly - https://www.googleapis.com/auth/chat.customemojis

Parameters:

  • name (String)

    Required. Resource name of the custom emoji. Format: customEmojis/ customEmojiYou can use the emoji name as an alias forcustomEmoji`. For example,customEmojis/:example-emoji:where:example-emoji:` is the emoji name for a custom emoji.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



170
171
172
173
174
175
176
177
178
# File 'lib/google/apis/chat_v1/service.rb', line 170

def get_custom_emoji(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::CustomEmoji::Representation
  command.response_class = Google::Apis::ChatV1::CustomEmoji
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_space(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space

Returns 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: - https://www.googleapis.com/auth/chat.bot - https:// www.googleapis.com/auth/chat.app.spaces with administrator approval - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.spaces.readonly - https://www.googleapis.com/auth/chat.spaces - User authentication grants administrator privileges when an administrator account authenticates, use_admin_access is true, and one of the following authorization scopes is used: - https://www.googleapis.com/auth/chat.admin. spaces.readonly - https://www.googleapis.com/auth/chat.admin.spaces App authentication has the following limitations: - space.access_settings is only populated when using the chat.app.spaces scope. - space. predefind_permission_settings and space.permission_settings are only populated when using the chat.app.spaces scope, and only for spaces the app created.

Parameters:

  • name (String)

    Required. Resource name of the space, in the form spaces/space. Format: ` spaces/`space

  • use_admin_access (Boolean) (defaults to: nil)

    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.spaces or chat.admin.spaces.readonly OAuth 2.0 scopes.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



655
656
657
658
659
660
661
662
663
664
# File 'lib/google/apis/chat_v1/service.rb', line 655

def get_space(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Space::Representation
  command.response_class = Google::Apis::ChatV1::Space
  command.params['name'] = name unless name.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_space_member(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership

Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership. Supports the following types of authentication: - App authentication with one of the following authorization scopes: - https:// www.googleapis.com/auth/chat.bot - https://www.googleapis.com/auth/chat.app. memberships (requires administrator approval) - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.memberships. readonly - https://www.googleapis.com/auth/chat.memberships - User authentication grants administrator privileges when an administrator account authenticates, use_admin_access is true, and one of the following authorization scopes is used: - https://www.googleapis.com/auth/chat.admin. memberships.readonly - https://www.googleapis.com/auth/chat.admin. memberships

Parameters:

  • 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/memberor ` spaces/`space`/members/app` You can use the user's email as an alias for member`. For example,spaces/space/members/example@gmail.comwhere example@gmail.com` is the email of the Google Chat user.

  • use_admin_access (Boolean) (defaults to: nil)

    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.memberships or chat.admin.memberships.readonly OAuth 2.0 scopes. Getting app memberships in a space isn't supported when using admin access.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
# File 'lib/google/apis/chat_v1/service.rb', line 1221

def get_space_member(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Membership::Representation
  command.response_class = Google::Apis::ChatV1::Membership
  command.params['name'] = name unless name.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_space_message(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Returns details about a message. For an example, see Get details about a message. Supports the following types of authentication: - App authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat. bot: When using this authorization scope, this method returns details about a message the Chat app has access to, like direct messages and slash commands that invoke the Chat app. - https://www.googleapis.com/auth/chat.app.messages.readonly with administrator approval. When using this authentication scope, this method returns details about a public message in a space. - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages. readonly - https://www.googleapis.com/auth/chat.messages Note: Might return a message from a blocked member or space.

Parameters:

  • name (String)

    Required. Resource name of the message. Format: spaces/space/messages/ messageIf you've set a custom ID for your message, you can use the value from the `clientAssignedMessageId` field formessage``. For details, see Name a message.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1580
1581
1582
1583
1584
1585
1586
1587
1588
# File 'lib/google/apis/chat_v1/service.rb', line 1580

def get_space_message(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Message::Representation
  command.response_class = Google::Apis::ChatV1::Message
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_space_message_attachment(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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 with the authorization scope: - https://www.googleapis.com/auth/chat.bot

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1845
1846
1847
1848
1849
1850
1851
1852
1853
# File 'lib/google/apis/chat_v1/service.rb', line 1845

def get_space_message_attachment(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Attachment::Representation
  command.response_class = Google::Apis::ChatV1::Attachment
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_space_space_event(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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. Note: The permissionSettings field is not returned in the Space object of the Space event data for this request. Supports the following types of authentication with an authorization scope appropriate for reading the requested data: - App authentication with administrator approval with one of the following authorization scopes: - https://www.googleapis.com/auth/chat. app.spaces - https://www.googleapis.com/auth/chat.app.spaces.readonly - https://www.googleapis.com/auth/chat.app.messages.readonly - https://www. googleapis.com/auth/chat.app.memberships - https://www.googleapis.com/auth/ chat.app.memberships.readonly - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.spaces. readonly - https://www.googleapis.com/auth/chat.spaces - https://www. googleapis.com/auth/chat.messages.readonly - https://www.googleapis.com/auth/ chat.messages - https://www.googleapis.com/auth/chat.messages.reactions. readonly - https://www.googleapis.com/auth/chat.messages.reactions - https: //www.googleapis.com/auth/chat.memberships.readonly - https://www.googleapis. com/auth/chat.memberships To get an event, the authenticated caller must be a member of the space. For an example, see Get details about an event from a Google Chat space.

Parameters:

  • name (String)

    Required. The resource name of the space event. Format: spaces/space/ spaceEvents/spaceEvent``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2056
2057
2058
2059
2060
2061
2062
2063
2064
# File 'lib/google/apis/chat_v1/service.rb', line 2056

def get_space_space_event(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::SpaceEvent::Representation
  command.response_class = Google::Apis::ChatV1::SpaceEvent
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_availability_availability(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Availability

Returns availability information for a human user in Google Chat. For example, this can be used to check if a user is online or away, or to retrieve their custom status message. This method only retrieves the authenticated user's availability. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.users.availability.readonly - https://www.googleapis.com/auth/chat. users.availability

Parameters:

  • name (String)

    Required. The resource name of the availability to retrieve. Format: users/ user/availability user is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789. The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2196
2197
2198
2199
2200
2201
2202
2203
2204
# File 'lib/google/apis/chat_v1/service.rb', line 2196

def get_user_availability_availability(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::Availability::Representation
  command.response_class = Google::Apis::ChatV1::Availability
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_space_space_notification_setting(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceNotificationSetting

Gets the space notification setting. For an example, see Get the caller's space notification setting. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/chat.users. spacesettings

Parameters:

  • name (String)

    Required. Format: users/user/spaces/space/spaceNotificationSetting - users/me/spaces/space/spaceNotificationSetting, OR - users/user@example. com/spaces/space/spaceNotificationSetting, OR - users/123456789/spaces/ space/spaceNotificationSetting. Note: Only the caller's user id or email is allowed in the path.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2828
2829
2830
2831
2832
2833
2834
2835
2836
# File 'lib/google/apis/chat_v1/service.rb', line 2828

def get_user_space_space_notification_setting(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::SpaceNotificationSetting::Representation
  command.response_class = Google::Apis::ChatV1::SpaceNotificationSetting
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_space_space_read_state(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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 with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.users.readstate.readonly - https://www.googleapis.com/auth/chat.users. readstate

Parameters:

  • 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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2738
2739
2740
2741
2742
2743
2744
2745
2746
# File 'lib/google/apis/chat_v1/service.rb', line 2738

def get_user_space_space_read_state(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::SpaceReadState::Representation
  command.response_class = Google::Apis::ChatV1::SpaceReadState
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_space_thread_thread_read_state(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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 with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.users.readstate.readonly - https://www.googleapis.com/auth/chat.users. readstate

Parameters:

  • 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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2916
2917
2918
2919
2920
2921
2922
2923
2924
# File 'lib/google/apis/chat_v1/service.rb', line 2916

def get_user_space_thread_thread_read_state(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ChatV1::ThreadReadState::Representation
  command.response_class = Google::Apis::ChatV1::ThreadReadState
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_custom_emojis(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListCustomEmojisResponse

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: - https://www.googleapis.com/auth/ chat.customemojis.readonly - https://www.googleapis.com/auth/chat. customemojis

Parameters:

  • filter (String) (defaults to: nil)

    Optional. A query filter. Supports filtering by creator. To filter by creator, you must specify a valid value. Currently only creator("users/me") and NOT 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_ARGUMENT error.

  • page_size (Fixnum) (defaults to: nil)

    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) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



224
225
226
227
228
229
230
231
232
233
234
# File 'lib/google/apis/chat_v1/service.rb', line 224

def list_custom_emojis(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/customEmojis', options)
  command.response_representation = Google::Apis::ChatV1::ListCustomEmojisResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListCustomEmojisResponse
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_space_members(parent, filter: nil, page_size: nil, page_token: nil, show_groups: nil, show_invited: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListMembershipsResponse

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: - https://www.googleapis.com/auth/chat.bot - https:// www.googleapis.com/auth/chat.app.memberships (requires administrator approval) - User authentication with one of the following authorization scopes: - https:/ /www.googleapis.com/auth/chat.memberships.readonly - https://www.googleapis. com/auth/chat.memberships - https://www.googleapis.com/auth/chat.import ( import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, use_admin_access is true, and one of the following authorization scopes is used: - https://www.googleapis. com/auth/chat.admin.memberships.readonly - https://www.googleapis.com/auth/ chat.admin.memberships

Parameters:

  • parent (String)

    Required. The resource name of the space for which to fetch a membership list. Format: spaces/space

  • filter (String) (defaults to: nil)

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

  • page_size (Fixnum) (defaults to: nil)

    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) (defaults to: nil)

    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.

  • show_groups (Boolean) (defaults to: nil)

    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) (defaults to: nil)

    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) (defaults to: nil)

    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.readonly or chat.admin.memberships OAuth 2.0 scope. Listing app memberships in a space isn't supported when using admin access.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
# File 'lib/google/apis/chat_v1/service.rb', line 1321

def list_space_members(parent, filter: nil, page_size: nil, page_token: nil, show_groups: nil, show_invited: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/members', options)
  command.response_representation = Google::Apis::ChatV1::ListMembershipsResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListMembershipsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['showGroups'] = show_groups unless show_groups.nil?
  command.query['showInvited'] = show_invited unless show_invited.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_space_message_reactions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListReactionsResponse

Lists reactions to a message. For an example, see List reactions for a message. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.reactions. readonly - https://www.googleapis.com/auth/chat.messages.reactions - https: //www.googleapis.com/auth/chat.messages.readonly - https://www.googleapis. com/auth/chat.messages

Parameters:

  • parent (String)

    Required. The message users reacted to. Format: spaces/space/messages/ message``

  • filter (String) (defaults to: nil)

    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 with an INVALID_ARGUMENT error.

  • page_size (Fixnum) (defaults to: nil)

    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) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
# File 'lib/google/apis/chat_v1/service.rb', line 1994

def list_space_message_reactions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/reactions', options)
  command.response_representation = Google::Apis::ChatV1::ListReactionsResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListReactionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_space_messages(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListMessagesResponse

Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. System messages, like those announcing new space members, aren't included. 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](https://developers.google.com/workspace/chat/api/guides/v1/messages/ list). Supports the following types of [authentication](https://developers. google.com/workspace/chat/authenticate-authorize): - [App authentication]( https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the authorization scope: -https://www.googleapis.com/auth/chat.app. messages.readonly. When using this authentication scope, this method only returns public messages in a space. It doesn't include private messages. - [ User authentication](https://developers.google.com/workspace/chat/authenticate- authorize-chat-user) with one of the following authorization scopes: -https:/ /www.googleapis.com/auth/chat.messages.readonly` - https://www.googleapis.com/ auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only)

Parameters:

  • parent (String)

    Required. The resource name of the space to list messages from. Format: spaces/space``

  • filter (String) (defaults to: nil)

    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_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 anINVALID_ARGUMENT` error.

  • order_by (String) (defaults to: nil)

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

  • page_size (Fixnum) (defaults to: nil)

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

  • page_token (String) (defaults to: nil)

    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.

  • show_deleted (Boolean) (defaults to: nil)

    Optional. Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
# File 'lib/google/apis/chat_v1/service.rb', line 1666

def list_space_messages(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/messages', options)
  command.response_representation = Google::Apis::ChatV1::ListMessagesResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListMessagesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['showDeleted'] = show_deleted unless show_deleted.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_space_space_events(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSpaceEventsResponse

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. Supports the following types of authentication with an authorization scope appropriate for reading the requested data: - App authentication with administrator approval with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.app.spaces - https://www.googleapis.com/auth/chat.app.spaces.readonly - https://www. googleapis.com/auth/chat.app.messages.readonly - https://www.googleapis.com/ auth/chat.app.memberships - https://www.googleapis.com/auth/chat.app. memberships.readonly - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.spaces.readonly

  • https://www.googleapis.com/auth/chat.spaces - https://www.googleapis.com/ auth/chat.messages.readonly - https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly - https:/ /www.googleapis.com/auth/chat.messages.reactions - https://www.googleapis. com/auth/chat.memberships.readonly - https://www.googleapis.com/auth/chat. memberships To list events, the authenticated caller must be a member of the space. For an example, see List events from a Google Chat space.

Parameters:

  • parent (String)

    Required. Resource name of the Google Chat space where the events occurred. Format: spaces/space``.

  • filter (String) (defaults to: nil)

    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.

  • page_size (Fixnum) (defaults to: nil)

    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) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
# File 'lib/google/apis/chat_v1/service.rb', line 2151

def list_space_space_events(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/spaceEvents', options)
  command.response_representation = Google::Apis::ChatV1::ListSpaceEventsResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListSpaceEventsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSpacesResponse

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: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.spaces.readonly - https://www.googleapis.com/auth/chat.spaces To list all named spaces by Google Workspace organization, use the spaces.search() method using Workspace administrator privileges instead.

Parameters:

  • filter (String) (defaults to: nil)

    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.

  • page_size (Fixnum) (defaults to: nil)

    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) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



715
716
717
718
719
720
721
722
723
724
725
# File 'lib/google/apis/chat_v1/service.rb', line 715

def list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/spaces', options)
  command.response_representation = Google::Apis::ChatV1::ListSpacesResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListSpacesResponse
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_section_items(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSectionItemsResponse

Lists items in a section. Only spaces can be section items. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/chat.users.sections - https:// www.googleapis.com/auth/chat.users.sections.readonly

Parameters:

  • parent (String)

    Required. The parent, which is the section resource name that owns this collection of section items. Only supports listing section items for the calling user. When you're filtering by space, use the wildcard - to search across all sections. For example, users/user/sections/-. Format: users/ user/sections/section``

  • filter (String) (defaults to: nil)

    Optional. A query filter. Currently only supports filtering by space. For example, space = spaces/space`. Invalid queries are rejected with an INVALID_ARGUMENT` error.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of section items to return. The service may return fewer than this value. If unspecified, at most 10 section items will be returned. The maximum value is 100. If you use a value more than 100, it's automatically changed to 100. Negative values return an INVALID_ARGUMENT error.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous list section items call. Provide this 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
# File 'lib/google/apis/chat_v1/service.rb', line 2650

def list_user_section_items(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/items', options)
  command.response_representation = Google::Apis::ChatV1::ListSectionItemsResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListSectionItemsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_sections(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSectionsResponse

Lists sections available to the Chat user. Sections help users group their conversations and customize the list of spaces displayed in Chat navigation panel. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/ chat.users.sections - https://www.googleapis.com/auth/chat.users.sections. readonly

Parameters:

  • parent (String)

    Required. The parent, which is the user resource name that owns this collection of sections. Only supports listing sections for the calling user. To refer to the calling user, set one of the following: - The me alias. For example, users/me. - Their Workspace email address. For example, users/user@ example.com. - Their user id. For example, users/123456789. Format: users/ user``

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of sections to return. The service may return fewer than this value. If unspecified, at most 10 sections will be returned. The maximum value is 100. If you use a value more than 100, it's automatically changed to 100. Negative values return an INVALID_ARGUMENT error.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous list sections call. Provide this 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
# File 'lib/google/apis/chat_v1/service.rb', line 2506

def list_user_sections(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/sections', options)
  command.response_representation = Google::Apis::ChatV1::ListSectionsResponse::Representation
  command.response_class = Google::Apis::ChatV1::ListSectionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#mark_availability_as_active(name, mark_as_active_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Availability

Marks user as ACTIVE in Google Chat. Sets the user's availability state to ACTIVE. The ACTIVE state lasts until the specified expiration, at which point the user's state becomes AWAY. Note that if the user is actively using Chat, the ACTIVE state duration may extend beyond the provided expiration. This method only updates the authenticated user's availability. Requires user authentication with authorization scope: - https://www. googleapis.com/auth/chat.users.availability

Parameters:

  • name (String)

    Required. The resource name of the availability to mark as active. Format: users/user/availability user is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789. The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me.

  • mark_as_active_request_object (Google::Apis::ChatV1::MarkAsActiveRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
# File 'lib/google/apis/chat_v1/service.rb', line 2239

def mark_availability_as_active(name, mark_as_active_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:markAsActive', options)
  command.request_representation = Google::Apis::ChatV1::MarkAsActiveRequest::Representation
  command.request_object = mark_as_active_request_object
  command.response_representation = Google::Apis::ChatV1::Availability::Representation
  command.response_class = Google::Apis::ChatV1::Availability
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#mark_availability_as_away(name, mark_as_away_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Availability

Marks user as AWAY in Google Chat. Sets the user's state to away and is not affected by the user's activity. This method only updates the authenticated user's availability. Requires user authentication with authorization scope: - https://www.googleapis.com/auth/chat.users.availability

Parameters:

  • name (String)

    Required. The resource name of the availability to mark as away. Format: users/ user/availability user is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789. The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me.

  • mark_as_away_request_object (Google::Apis::ChatV1::MarkAsAwayRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
# File 'lib/google/apis/chat_v1/service.rb', line 2281

def mark_availability_as_away(name, mark_as_away_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:markAsAway', options)
  command.request_representation = Google::Apis::ChatV1::MarkAsAwayRequest::Representation
  command.request_object = mark_as_away_request_object
  command.response_representation = Google::Apis::ChatV1::Availability::Representation
  command.response_class = Google::Apis::ChatV1::Availability
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#mark_availability_as_do_not_disturb(name, mark_as_do_not_disturb_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Availability

Marks user asDO_NOT_DISTURB in Google Chat. Sets a user's availability state to DO_NOT_DISTURB until a specified expiration time. When in DO_NOT_DISTURB , users typically won't receive notifications. This method only updates the authenticated user's availability. Requires user authentication with authorization scope: - https://www.googleapis.com/auth/chat.users. availability

Parameters:

  • name (String)

    Required. The resource name of the availability to mark as Do Not Disturb. Format: users/user/availability user is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789. The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me.

  • mark_as_do_not_disturb_request_object (Google::Apis::ChatV1::MarkAsDoNotDisturbRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
# File 'lib/google/apis/chat_v1/service.rb', line 2325

def mark_availability_as_do_not_disturb(name, mark_as_do_not_disturb_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:markAsDoNotDisturb', options)
  command.request_representation = Google::Apis::ChatV1::MarkAsDoNotDisturbRequest::Representation
  command.request_object = mark_as_do_not_disturb_request_object
  command.response_representation = Google::Apis::ChatV1::Availability::Representation
  command.response_class = Google::Apis::ChatV1::Availability
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#move_section_item(name, move_section_item_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::MoveSectionItemResponse

Moves an item from one section to another. For example, if a section contains spaces, this method can be used to move a space to a different section. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/ chat.users.sections

Parameters:

  • name (String)

    Required. The resource name of the section item to move. Format: users/user/ sections/section/items/item``

  • move_section_item_request_object (Google::Apis::ChatV1::MoveSectionItemRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
# File 'lib/google/apis/chat_v1/service.rb', line 2692

def move_section_item(name, move_section_item_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:move', options)
  command.request_representation = Google::Apis::ChatV1::MoveSectionItemRequest::Representation
  command.request_object = move_section_item_request_object
  command.response_representation = Google::Apis::ChatV1::MoveSectionItemResponse::Representation
  command.response_class = Google::Apis::ChatV1::MoveSectionItemResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_space(name, space_object = nil, update_mask: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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. Supports the following types of authentication: - App authentication with administrator approval and one of the following authorization scopes: - https://www. googleapis.com/auth/chat.app.spaces - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.spaces - https://www.googleapis.com/auth/chat.import (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, use_admin_access is true, and the following authorization scopes is used: - https://www.googleapis.com/auth/ chat.admin.spaces App authentication has the following limitations: - To update either space.predefined_permission_settings or space. permission_settings, the app must be the space creator. - Updating the space. access_settings.audience is not supported for app authentication.

Parameters:

  • name (String)

    Identifier. Resource name of the space. Format: spaces/spaceWherespace represents the system-assigned ID for the space. You can obtain the space ID by calling the spaces.list() method or from the space URL. For example, if the space URL is https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA, the space ID is AAAAAAAAA.

  • space_object (Google::Apis::ChatV1::Space) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    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 and guidelines. You must pass both description and guidelines in the update request as SpaceDetails. If you only want to update one of the fields, pass the existing value for the other field. display_name: Only supports updating the display name for spaces where spaceType field is SPACE. If you receive the error message ALREADY_EXISTS, try a different value. An existing space within the Google Workspace organization might already use this display name. space_type: Only supports changing a GROUP_CHAT space type to SPACE. Include display_name together with space_type in the update mask and ensure that the specified space has a non- empty display name and the SPACE space type. Including the space_type mask and the SPACE type in the specified space when updating the display name is optional if the existing space already has the SPACE type. Trying to update the space type in other ways results in an invalid argument error. space_type is not supported with useAdminAccess. space_history_state: Updates space history settings by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request. space_history_state is not supported with useAdminAccess. access_settings. audience: Updates the access setting of who can discover the space, join the space, and preview the messages in named space where spaceType field is SPACE. If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can't update this field if the space is in import mode . To learn more, see Make a space discoverable to specific users. access_settings. audience is not supported with useAdminAccess. permission_settings: Supports changing the permission settings of a space. When updating permission settings, you can only specify permissionSettings field masks; you cannot update other field masks at the same time. The supported field masks include: - permission_settings. manageMembersAndGroups - permission_settings.modifySpaceDetails - permission_settings.toggleHistory - permission_settings.useAtMentionAll - permission_settings.manageApps - permission_settings.manageWebhooks - permission_settings.replyMessages

  • use_admin_access (Boolean) (defaults to: nil)

    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.spaces OAuth 2.0 scope. Some FieldMask values are not supported using admin access. For details, see the description of update_mask.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



821
822
823
824
825
826
827
828
829
830
831
832
833
# File 'lib/google/apis/chat_v1/service.rb', line 821

def patch_space(name, space_object = nil, update_mask: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::Space::Representation
  command.request_object = space_object
  command.response_representation = Google::Apis::ChatV1::Space::Representation
  command.response_class = Google::Apis::ChatV1::Space
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_space_member(name, membership_object = nil, update_mask: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership

Updates a membership. For an example, see Update a user's membership in a space. Supports the following types of authentication: - App authentication with administrator approval 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. memberships - https://www.googleapis.com/auth/chat.import (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, use_admin_access is true, and the following authorization scope is used: - https://www.googleapis.com/auth/chat. admin.memberships

Parameters:

  • name (String)

    Identifier. Resource name of the membership, assigned by the server. Format: spaces/space/members/member``

  • membership_object (Google::Apis::ChatV1::Membership) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    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) (defaults to: nil)

    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.memberships OAuth 2.0 scope.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
# File 'lib/google/apis/chat_v1/service.rb', line 1383

def patch_space_member(name, membership_object = nil, update_mask: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::Membership::Representation
  command.request_object = membership_object
  command.response_representation = Google::Apis::ChatV1::Membership::Representation
  command.response_class = Google::Apis::ChatV1::Membership
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https:/ /www.googleapis.com/auth/chat.messages - https://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.

Parameters:

  • name (String)

    Identifier. Resource name of the message. Format: spaces/space/messages/ messageWherespaceis the ID of the space where the message is posted andmessageis a system-assigned ID for the message. For example, `spaces/ AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacingmessage`with the value from theclientAssignedMessageIdfield. For example,spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see Name a message.

  • message_object (Google::Apis::ChatV1::Message) (defaults to: nil)
  • allow_missing (Boolean) (defaults to: nil)

    Optional. If true and the message isn't found, a new message is created and updateMask is ignored. The specified message ID must be client-assigned or the request fails.

  • update_mask (String) (defaults to: nil)

    Required. The field paths to update. Separate multiple values with commas or use * to update all field paths. Currently supported field paths: - text - attachment - cards (Requires app authentication.) - cards_v2 (Requires app authentication.) - accessory_widgets (Requires app authentication.) - quoted_message_metadata (Only allows removal of the quoted message.)

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
# File 'lib/google/apis/chat_v1/service.rb', line 1735

def patch_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::Message::Representation
  command.request_object = message_object
  command.response_representation = Google::Apis::ChatV1::Message::Representation
  command.response_class = Google::Apis::ChatV1::Message
  command.params['name'] = name unless name.nil?
  command.query['allowMissing'] = allow_missing unless allow_missing.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_user_section(name, google_chat_v1_section_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::GoogleChatV1Section

Updates a section. Only sections of type CUSTOM_SECTION can be updated. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/ chat.users.sections

Parameters:

  • name (String)

    Identifier. Resource name of the section. For system sections, the section ID is a constant string: - DEFAULT_DIRECT_MESSAGES: users/user/sections/ default-direct-messages - DEFAULT_SPACES: users/user/sections/default- spaces - DEFAULT_APPS: users/user/sections/default-apps Format: users/ user/sections/section``

  • google_chat_v1_section_object (Google::Apis::ChatV1::GoogleChatV1Section) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. The mask to specify which fields to update. Currently supported field paths: - display_name

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
# File 'lib/google/apis/chat_v1/service.rb', line 2552

def patch_user_section(name, google_chat_v1_section_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::GoogleChatV1Section::Representation
  command.request_object = google_chat_v1_section_object
  command.response_representation = Google::Apis::ChatV1::GoogleChatV1Section::Representation
  command.response_class = Google::Apis::ChatV1::GoogleChatV1Section
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_user_space_space_notification_setting(name, space_notification_setting_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceNotificationSetting

Updates the space notification setting. For an example, see Update the caller' s space notification setting. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/ chat.users.spacesettings

Parameters:

  • name (String)

    Identifier. The resource name of the space notification setting. Format: users/user/spaces/space/spaceNotificationSetting.

  • space_notification_setting_object (Google::Apis::ChatV1::SpaceNotificationSetting) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. Supported field paths: - notification_setting - mute_setting

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
# File 'lib/google/apis/chat_v1/service.rb', line 2868

def patch_user_space_space_notification_setting(name, space_notification_setting_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::SpaceNotificationSetting::Representation
  command.request_object = space_notification_setting_object
  command.response_representation = Google::Apis::ChatV1::SpaceNotificationSetting::Representation
  command.response_class = Google::Apis::ChatV1::SpaceNotificationSetting
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#position_section(name, position_section_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::PositionSectionResponse

Changes the sort order of a section. For details, see Create and organize sections in Google Chat. Requires user authentication with the authorization scope: - https://www.googleapis.com/auth/chat.users.sections

Parameters:

  • name (String)

    Required. The resource name of the section to position. Format: users/user/ sections/section``

  • position_section_request_object (Google::Apis::ChatV1::PositionSectionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
# File 'lib/google/apis/chat_v1/service.rb', line 2592

def position_section(name, position_section_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:position', options)
  command.request_representation = Google::Apis::ChatV1::PositionSectionRequest::Representation
  command.request_object = position_section_request_object
  command.response_representation = Google::Apis::ChatV1::PositionSectionResponse::Representation
  command.response_class = Google::Apis::ChatV1::PositionSectionResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#search_spaces(order_by: nil, page_size: nil, page_token: nil, query: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SearchSpacesResponse

Returns a list of spaces in a Google Workspace organization. For an example, see Search for and manage spaces. When use_admin_access is set to false, the results are limited to spaces where the calling user is a joined member. To search with administrator privileges, set use_admin_access to true. Setting use_admin_access to false is available under Developer Preview. Supports the following types of authentication: - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/ chat.spaces.readonly - https://www.googleapis.com/auth/chat.spaces - User authentication with administrator privileges and one of the following authorization scopes: - https://www.googleapis.com/ auth/chat.admin.spaces.readonly - https://www.googleapis.com/auth/chat.admin. spaces

Parameters:

  • order_by (String) (defaults to: nil)

    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. When useAdminAccess is false, only create_time and relevance are supported for ordering. Only DESC is supported for these fields in non-admin searches. Valid ordering operation values are: - ASC for ascending. Default value. - DESC for descending. The supported syntax are when useAdminAccess is set to true : - membership_count.joined_direct_human_user_count DESC - membership_count. joined_direct_human_user_count ASC - last_active_time DESC - last_active_time ASC - create_time DESC - create_time ASC When useAdminAccess is set to false: - create_time DESC - relevance DESC

  • page_size (Fixnum) (defaults to: nil)

    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

    1. If you use a value more than 1000, it's automatically changed to 1000.
  • page_token (String) (defaults to: nil)

    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) (defaults to: nil)

    Required. A search query. You can search by using the following parameters when useAdminAccess is set to true: - create_time - customer - display_name - external_user_allowed - last_active_time - space_history_state - space_type When useAdminAccess is set to false: - display_name - external_user_allowed create_time and last_active_time accept a timestamp in RFC-3339 format and the supported comparison operators are: =, <, >, <=, >=. customer is required when useAdminAccess is set to true, and is used to indicate which customer to fetch spaces from. customers/my_customer is the only supported value. display_name only accepts the HAS (:) 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's display_name. For example, Fun Eve matches Fun event or The evening was fun, but not notFun event or even. When useAdminAccess is set to false, display_name is required to retrieve meaningful results. Otherwise, the default behavior is to return an empty response. external_user_allowed accepts either true or false. space_history_state only accepts values from the historyState field of a space resource. space_type is required when useAdminAccess is set to true, and the only valid value is SPACE. Across different fields, only AND operators are supported. A valid example is space_type = "SPACE" AND display_name:"Hello" and an invalid example is space_type = "SPACE" OR display_name:"Hello". Among the same field, space_type doesn't support AND or OR operators. display_name, 'space_history_state', and ' external_user_allowed' only support OR operators. last_active_time and create_time support both AND and OR operators. AND can only be used to represent an interval, such as last_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 when useAdminAccess is set to true: 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") The following example queries are valid when useAdminAccess is set to false: display_name:"Hello World" ( display_name:"Hello" OR display_name:"Fun") (external_user_allowed = "true") // Returns an empty response. (external_user_allowed = "true" AND display_name:" Hello")

  • use_admin_access (Boolean) (defaults to: nil)

    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.readonly or chat. admin.spaces OAuth 2.0 scope. Setting use_admin_access to false is available under Developer Preview. Developer Preview.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



947
948
949
950
951
952
953
954
955
956
957
958
959
# File 'lib/google/apis/chat_v1/service.rb', line 947

def search_spaces(order_by: nil, page_size: nil, page_token: nil, query: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/spaces:search', options)
  command.response_representation = Google::Apis::ChatV1::SearchSpacesResponse::Representation
  command.response_class = Google::Apis::ChatV1::SearchSpacesResponse
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['query'] = query unless query.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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, whereusercan be the email address for the user. For users in the same Workspace organization usercan 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: - https://www. googleapis.com/auth/chat.spaces.create - https://www.googleapis.com/auth/ chat.spaces

Parameters:

  • set_up_space_request_object (Google::Apis::ChatV1::SetUpSpaceRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
# File 'lib/google/apis/chat_v1/service.rb', line 1020

def setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/spaces:setup', options)
  command.request_representation = Google::Apis::ChatV1::SetUpSpaceRequest::Representation
  command.request_object = set_up_space_request_object
  command.response_representation = Google::Apis::ChatV1::Space::Representation
  command.response_class = Google::Apis::ChatV1::Space
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https:/ /www.googleapis.com/auth/chat.messages - https://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.

Parameters:

  • name (String)

    Identifier. Resource name of the message. Format: spaces/space/messages/ messageWherespaceis the ID of the space where the message is posted andmessageis a system-assigned ID for the message. For example, `spaces/ AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacingmessage`with the value from theclientAssignedMessageIdfield. For example,spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see Name a message.

  • message_object (Google::Apis::ChatV1::Message) (defaults to: nil)
  • allow_missing (Boolean) (defaults to: nil)

    Optional. If true and the message isn't found, a new message is created and updateMask is ignored. The specified message ID must be client-assigned or the request fails.

  • update_mask (String) (defaults to: nil)

    Required. The field paths to update. Separate multiple values with commas or use * to update all field paths. Currently supported field paths: - text - attachment - cards (Requires app authentication.) - cards_v2 (Requires app authentication.) - accessory_widgets (Requires app authentication.) - quoted_message_metadata (Only allows removal of the quoted message.)

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
# File 'lib/google/apis/chat_v1/service.rb', line 1803

def update_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::Message::Representation
  command.request_object = message_object
  command.response_representation = Google::Apis::ChatV1::Message::Representation
  command.response_class = Google::Apis::ChatV1::Message
  command.params['name'] = name unless name.nil?
  command.query['allowMissing'] = allow_missing unless allow_missing.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_availability_availability(name, availability_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Availability

Updates availability information for a human user. Only the custom_status field can be updated through this method. This method only updates the authenticated user's availability. Requires user authentication with one of the following authorization scopes: - https://www. googleapis.com/auth/chat.users.availability

Parameters:

  • name (String)

    Identifier. Resource name of the user's availability. Format: users/user/ availability user is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789. The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@ example.com or users/me.

  • availability_object (Google::Apis::ChatV1::Availability) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. The list of fields to update. The only field that can be updated is custom_status.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
# File 'lib/google/apis/chat_v1/service.rb', line 2371

def update_user_availability_availability(name, availability_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::Availability::Representation
  command.request_object = availability_object
  command.response_representation = Google::Apis::ChatV1::Availability::Representation
  command.response_class = Google::Apis::ChatV1::Availability
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_space_space_read_state(name, space_read_state_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::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 with the authorization scope: - https://www. googleapis.com/auth/chat.users.readstate

Parameters:

  • name (String)

    Resource name of the space read state. Format: users/user/spaces/space/ spaceReadState

  • space_read_state_object (Google::Apis::ChatV1::SpaceReadState) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
# File 'lib/google/apis/chat_v1/service.rb', line 2785

def update_user_space_space_read_state(name, space_read_state_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ChatV1::SpaceReadState::Representation
  command.request_object = space_read_state_object
  command.response_representation = Google::Apis::ChatV1::SpaceReadState::Representation
  command.response_class = Google::Apis::ChatV1::SpaceReadState
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#upload_medium_attachment(parent, upload_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::UploadAttachmentResponse

Uploads 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.create - https://www.googleapis.com/auth/chat.messages - https://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.

Parameters:

  • parent (String)

    Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/space".

  • upload_attachment_request_object (Google::Apis::ChatV1::UploadAttachmentRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/google/apis/chat_v1/service.rb', line 310

def upload_medium_attachment(parent, upload_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'v1/{+parent}/attachments:upload', options)
  else
    command = make_upload_command(:post, 'v1/{+parent}/attachments:upload', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::ChatV1::UploadAttachmentRequest::Representation
  command.request_object = upload_attachment_request_object
  command.response_representation = Google::Apis::ChatV1::UploadAttachmentResponse::Representation
  command.response_class = Google::Apis::ChatV1::UploadAttachmentResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end