Class: Google::Apis::ChatV1::HangoutsChatService
- Inherits:
-
Google::Apis::Core::BaseService
- Object
- Google::Apis::Core::BaseService
- Google::Apis::ChatV1::HangoutsChatService
- Defined in:
- generated/google/apis/chat_v1/service.rb
Overview
Hangouts Chat API
Enables bots to fetch information and perform actions in Hangouts Chat.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#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.
-
#delete_space_message(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty
Deletes a message.
-
#download_medium(resource_name, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Media
Downloads media.
-
#get_space(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Returns a space.
-
#get_space_member(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Returns a membership.
-
#get_space_message(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Returns a message.
-
#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.
-
#initialize ⇒ HangoutsChatService
constructor
A new instance of HangoutsChatService.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
Constructor Details
#initialize ⇒ HangoutsChatService
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
#key ⇒ String
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.
38 39 40 |
# File 'generated/google/apis/chat_v1/service.rb', line 38 def key @key end |
#quota_user ⇒ String
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.
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.
560 561 562 563 564 565 566 567 568 569 570 571 |
# File 'generated/google/apis/chat_v1/service.rb', line 560 def (parent, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/messages', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
594 595 596 597 598 599 600 601 602 |
# File 'generated/google/apis/chat_v1/service.rb', line 594 def (name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) 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
.
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}', ) else command = make_download_command(:get, 'v1/media/{+resourceName}', ) 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.
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}', ) 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.
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}', ) 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.
625 626 627 628 629 630 631 632 633 |
# File 'generated/google/apis/chat_v1/service.rb', line 625 def (name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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.
695 696 697 698 699 700 701 702 703 |
# File 'generated/google/apis/chat_v1/service.rb', line 695 def (name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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.
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', ) 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.
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', ) 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.
81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'generated/google/apis/chat_v1/service.rb', line 81 def (parent, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/messages', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'generated/google/apis/chat_v1/service.rb', line 169 def (parent, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/messages', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'generated/google/apis/chat_v1/service.rb', line 251 def (parent, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/messages', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'generated/google/apis/chat_v1/service.rb', line 339 def (parent, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/messages', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
660 661 662 663 664 665 666 667 668 669 670 671 |
# File 'generated/google/apis/chat_v1/service.rb', line 660 def (name, = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v1/{+name}', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
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, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/webhooks', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
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, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/webhooks', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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.
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, = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/webhooks', ) command.request_representation = Google::Apis::ChatV1::Message::Representation command.request_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 |