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

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

Overview

Hangouts Chat API

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

Examples:

require 'google/apis/chat_v1'

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

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHangoutsChatService

Returns a new instance of HangoutsChatService.



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

def initialize
  super('https://chat.googleapis.com/', '')
  @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.



38
39
40
# File 'generated/google/apis/chat_v1/service.rb', line 38

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.



43
44
45
# File 'generated/google/apis/chat_v1/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

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

Creates a message.

Parameters:

  • parent (String)

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

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

    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.

  • 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



560
561
562
563
564
565
566
567
568
569
570
571
# File 'generated/google/apis/chat_v1/service.rb', line 560

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty

Deletes a message.

Parameters:

  • name (String)

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

  • 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



594
595
596
597
598
599
600
601
602
# File 'generated/google/apis/chat_v1/service.rb', line 594

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) {|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



205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'generated/google/apis/chat_v1/service.rb', line 205

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space

Returns a space.

Parameters:

  • name (String)

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

  • 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



373
374
375
376
377
378
379
380
381
# File 'generated/google/apis/chat_v1/service.rb', line 373

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership

Returns a membership.

Parameters:

  • name (String)

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

  • 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



482
483
484
485
486
487
488
489
490
# File 'generated/google/apis/chat_v1/service.rb', line 482

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Returns a message.

Parameters:

  • name (String)

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

  • 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



625
626
627
628
629
630
631
632
633
# File 'generated/google/apis/chat_v1/service.rb', line 625

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.

Parameters:

  • name (String)

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

  • 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



695
696
697
698
699
700
701
702
703
# File 'generated/google/apis/chat_v1/service.rb', line 695

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListMembershipsResponse

Lists human memberships in a space.

Parameters:

  • parent (String)

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

  • page_size (Fixnum) (defaults to: nil)

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

  • page_token (String) (defaults to: nil)

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

  • 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



518
519
520
521
522
523
524
525
526
527
528
# File 'generated/google/apis/chat_v1/service.rb', line 518

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSpacesResponse

Lists spaces the caller is a member of.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

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

  • page_token (String) (defaults to: nil)

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

  • 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



406
407
408
409
410
411
412
413
414
415
# File 'generated/google/apis/chat_v1/service.rb', line 406

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Legacy path for creating message. Calling these will result in a BadRequest response.

Parameters:

  • parent (String)

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

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

    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.

  • 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



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

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Legacy path for creating message. Calling these will result in a BadRequest response.

Parameters:

  • parent (String)

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

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

    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.

  • 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



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

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Legacy path for creating message. Calling these will result in a BadRequest response.

Parameters:

  • parent (String)

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

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

    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.

  • 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



251
252
253
254
255
256
257
258
259
260
261
262
# File 'generated/google/apis/chat_v1/service.rb', line 251

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Legacy path for creating message. Calling these will result in a BadRequest response.

Parameters:

  • parent (String)

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

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

    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.

  • 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



339
340
341
342
343
344
345
346
347
348
349
350
# File 'generated/google/apis/chat_v1/service.rb', line 339

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Updates a message.

Parameters:

  • name (String)

    Resource name, in the form "spaces//messages/". Example: spaces/AAAAMpdlehY/ messages/UMxbHmzDlr4.UMxbHmzDlr4

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

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

  • 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



660
661
662
663
664
665
666
667
668
669
670
671
# File 'generated/google/apis/chat_v1/service.rb', line 660

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Legacy path for creating message. Calling these will result in a BadRequest response.

Parameters:

  • parent (String)

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

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

    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.

  • 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



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

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Legacy path for creating message. Calling these will result in a BadRequest response.

Parameters:

  • parent (String)

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

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

    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.

  • 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



295
296
297
298
299
300
301
302
303
304
305
306
# File 'generated/google/apis/chat_v1/service.rb', line 295

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) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message

Legacy path for creating message. Calling these will result in a BadRequest response.

Parameters:

  • parent (String)

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

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

    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.

  • 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



448
449
450
451
452
453
454
455
456
457
458
459
# File 'generated/google/apis/chat_v1/service.rb', line 448

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