class Google::Apis::ChatV1::HangoutsChatService

Google Chat API

Enables bots to fetch information and perform actions in Google Chat.

Authentication using a service account is a prerequisite for using the Google
Chat REST API.

@example

require 'google/apis/chat_v1'

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

@see developers.google.com/hangouts/chat

Attributes

key[RW]

@return [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.
quota_user[RW]

@return [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.

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/google/apis/chat_v1/service.rb, line 47
def initialize
  super('https://chat.googleapis.com/', '',
        client_name: 'google-apis-chat_v1',
        client_version: Google::Apis::ChatV1::GEM_VERSION)
  @batch_path = 'batch'
end

Public Instance Methods

create_space_message(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Creates a message. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 564
def create_space_message(parent, message_object = 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['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
delete_space_message(name, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Deletes a message. @param [String] name

Required. Resource name of the message to be deleted, in the form "spaces/*/
messages/*" Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Empty] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Empty]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 598
def delete_space_message(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, &block) click to toggle source

Downloads media. Download is supported on the URI `/v1/media/`+name`?alt=media` . @param [String] resource_name

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

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [IO, String] download_dest

IO stream or filename to receive content download

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Media] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Media]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 209
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
get_space(name, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Returns a space. @param [String] name

Required. Resource name of the space, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Space] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Space]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 377
def get_space(name, 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['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, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Returns a membership. @param [String] name

Required. Resource name of the membership to be retrieved, in the form "spaces/
*/members/*". Example: spaces/AAAAMpdlehY/members/105115627578887013105

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Membership] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Membership]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 486
def get_space_member(name, 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['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, &block) click to toggle source

Returns a message. @param [String] name

Required. Resource name of the message to be retrieved, in the form "spaces/*/
messages/*". Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 629
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, &block) click to toggle source

Gets the metadata of a message attachment. The attachment data is fetched using the media API. @param [String] name

Resource name of the attachment, in the form "spaces/*/messages/*/attachments/*
".

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Attachment] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Attachment]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 697
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
list_space_members(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists human memberships in a space. @param [String] parent

Required. The resource name of the space for which membership list is to be
fetched, in the form "spaces/*". Example: spaces/AAAAMpdlehY

@param [Fixnum] page_size

Requested page size. The value is capped at 1000. Server may return fewer
results than requested. If unspecified, server will default to 100.

@param [String] page_token

A token identifying a page of results the server should return.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::ListMembershipsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::ListMembershipsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 522
def list_space_members(parent, page_size: nil, page_token: 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['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(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists spaces the caller is a member of. @param [Fixnum] page_size

Requested page size. The value is capped at 1000. Server may return fewer
results than requested. If unspecified, server will default to 100.

@param [String] page_token

A token identifying a page of results the server should return.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::ListSpacesResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::ListSpacesResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 410
def list_spaces(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['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
messages_dm(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Legacy path for creating message. Calling these will result in a BadRequest response. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 85
def messages_dm(parent, message_object = 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['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
messages_dm_conversation(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Legacy path for creating message. Calling these will result in a BadRequest response. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 173
def messages_dm_conversation(parent, message_object = 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['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
messages_room(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Legacy path for creating message. Calling these will result in a BadRequest response. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 255
def messages_room(parent, message_object = 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['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
messages_room_conversation(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Legacy path for creating message. Calling these will result in a BadRequest response. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 343
def messages_room_conversation(parent, message_object = 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['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
update_space_message(name, message_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates a message. @param [String] name @param [Google::Apis::ChatV1::Message] message_object @param [String] update_mask

Required. The field paths to be updated, comma separated if there are multiple.
Currently supported field paths: * text * cards

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 662
def update_space_message(name, message_object = 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['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
webhooks_dm(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Legacy path for creating message. Calling these will result in a BadRequest response. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 129
def webhooks_dm(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/webhooks', 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['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
webhooks_room(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Legacy path for creating message. Calling these will result in a BadRequest response. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 299
def webhooks_room(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/webhooks', 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['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
webhooks_space(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Legacy path for creating message. Calling these will result in a BadRequest response. @param [String] parent

Required. Space resource name, in the form "spaces/*". Example: spaces/
AAAAMpdlehY

@param [Google::Apis::ChatV1::Message] message_object @param [String] thread_key

Optional. Opaque thread identifier string that can be specified to group
messages into a single thread. If this is the first message with a given
thread identifier, a new thread is created. Subsequent messages with the same
thread identifier will be posted into the same thread. This relieves bots and
webhooks from having to store the Hangouts Chat thread ID of a thread (created
earlier by them) to post further updates to it. Has no effect if thread field,
corresponding to an existing thread, is set in message.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ChatV1::Message] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ChatV1::Message]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/chat_v1/service.rb, line 452
def webhooks_space(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/webhooks', 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['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

Protected Instance Methods

apply_command_defaults(command) click to toggle source
# File lib/google/apis/chat_v1/service.rb, line 709
def apply_command_defaults(command)
  command.query['key'] = key unless key.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
end