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

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

Overview

Hangouts Chat API

Enables bots to fetch information and perform actions in the new 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

Attributes inherited from Google::Apis::Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Google::Apis::Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Google::Apis::Core::Logging

#logger

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)

    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)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



220
221
222
223
224
225
226
227
228
229
230
231
# File 'generated/google/apis/chat_v1/service.rb', line 220

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)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

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

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

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



71
72
73
74
75
76
77
78
79
# File 'generated/google/apis/chat_v1/service.rb', line 71

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)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



138
139
140
141
142
143
144
145
146
# File 'generated/google/apis/chat_v1/service.rb', line 138

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)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



287
288
289
290
291
292
293
294
295
# File 'generated/google/apis/chat_v1/service.rb', line 287

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

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

    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)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



176
177
178
179
180
181
182
183
184
185
186
# File 'generated/google/apis/chat_v1/service.rb', line 176

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)

    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)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



105
106
107
108
109
110
111
112
113
114
# File 'generated/google/apis/chat_v1/service.rb', line 105

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

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

    Required. The field paths to be updated. Currently supported field paths: "text", "cards".

  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



322
323
324
325
326
327
328
329
330
331
332
333
# File 'generated/google/apis/chat_v1/service.rb', line 322

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