Class: Google::Apis::ChatV1::HangoutsChatService
- Inherits:
-
Google::Apis::Core::BaseService
- Object
- Google::Apis::Core::BaseService
- Google::Apis::ChatV1::HangoutsChatService
- Defined in:
- lib/google/apis/chat_v1/service.rb
Overview
Google Chat API
The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://chat.$UNIVERSE_DOMAIN$/"
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
-
#complete_import_space(name, complete_import_space_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::CompleteImportSpaceResponse
Completes the import process for the specified space and makes it visible to users.
-
#create_space(space_object = nil, request_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Creates a named space.
-
#create_space_member(parent, membership_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Creates a human membership or app membership for the calling app.
-
#create_space_message(parent, message_object = nil, message_id: nil, message_reply_option: nil, request_id: nil, thread_key: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Creates a message in a Google Chat space.
-
#create_space_message_reaction(parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Reaction
Creates a reaction and adds it to a message.
-
#delete_space(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty
Deletes a named space.
-
#delete_space_member(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Deletes a membership.
-
#delete_space_message(name, force: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty
Deletes a message.
-
#delete_space_message_reaction(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty
Deletes a reaction to a message.
-
#download_medium(resource_name, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Media
Downloads media.
-
#find_space_direct_message(name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Returns the existing direct message with the specified user.
-
#get_space(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Returns details about a space.
-
#get_space_member(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Returns details about a membership.
-
#get_space_message(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Returns details about 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.
-
#get_space_space_event(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceEvent
Returns an event from a Google Chat space.
-
#get_user_space_space_read_state(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceReadState
Returns details about a user's read state within a space, used to identify read and unread messages.
-
#get_user_space_thread_thread_read_state(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ThreadReadState
Returns details about a user's read state within a thread, used to identify read and unread messages.
-
#initialize ⇒ HangoutsChatService
constructor
A new instance of HangoutsChatService.
-
#list_space_members(parent, filter: nil, page_size: nil, page_token: nil, show_groups: nil, show_invited: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListMembershipsResponse
Lists memberships in a space.
-
#list_space_message_reactions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListReactionsResponse
Lists reactions to a message.
-
#list_space_messages(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListMessagesResponse
Lists messages in a space that the caller is a member of, including messages from blocked members and spaces.
-
#list_space_space_events(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSpaceEventsResponse
Lists events from a Google Chat space.
-
#list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSpacesResponse
Lists spaces the caller is a member of.
-
#patch_space(name, space_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Updates a space.
-
#patch_space_member(name, membership_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Updates a membership.
-
#patch_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Updates a message.
-
#setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Creates a space and adds specified users to it.
-
#update_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Updates a message.
-
#update_user_space_space_read_state(name, space_read_state_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceReadState
Updates a user's read state within a space, used to identify read and unread messages.
-
#upload_medium_attachment(parent, upload_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::UploadAttachmentResponse
Uploads an attachment.
Constructor Details
#initialize ⇒ HangoutsChatService
Returns a new instance of HangoutsChatService.
48 49 50 51 52 53 |
# File 'lib/google/apis/chat_v1/service.rb', line 48 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-chat_v1', client_version: Google::Apis::ChatV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#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.
41 42 43 |
# File 'lib/google/apis/chat_v1/service.rb', line 41 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.
46 47 48 |
# File 'lib/google/apis/chat_v1/service.rb', line 46 def quota_user @quota_user end |
Instance Method Details
#complete_import_space(name, complete_import_space_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::CompleteImportSpaceResponse
Completes the import process for the specified space and makes it visible to users. Requires app authentication and domain-wide delegation. For more information, see Authorize Google Chat apps to import data.
168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/google/apis/chat_v1/service.rb', line 168 def complete_import_space(name, complete_import_space_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:completeImport', ) command.request_representation = Google::Apis::ChatV1::CompleteImportSpaceRequest::Representation command.request_object = complete_import_space_request_object command.response_representation = Google::Apis::ChatV1::CompleteImportSpaceResponse::Representation command.response_class = Google::Apis::ChatV1::CompleteImportSpaceResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_space(space_object = nil, request_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Creates a named space. Spaces grouped by topics aren't supported. For an
example, see Create a space. If you receive the error message ALREADY_EXISTS
when
creating a space, try a different displayName
. An existing space within the
Google Workspace organization might already use this display name. Requires
user authentication.
210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/google/apis/chat_v1/service.rb', line 210 def create_space(space_object = nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/spaces', ) command.request_representation = Google::Apis::ChatV1::Space::Representation command.request_object = space_object command.response_representation = Google::Apis::ChatV1::Space::Representation command.response_class = Google::Apis::ChatV1::Space command.query['requestId'] = request_id unless request_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_space_member(parent, membership_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Creates a human membership or app membership for the calling app. Creating
memberships for other apps isn't supported. For an example, see Invite or add
a user or a Google Chat app to a space. When creating a membership, if the specified
member has their auto-accept policy turned off, then they're invited, and must
accept the space invitation before joining. Otherwise, creating a membership
adds the member directly to the specified space. Requires user authentication
. To specify the member to add, set the membership.member.name
for the human
or app member, or set the membership.group_member.name
for the group member.
- To add the calling app to a space or a direct message between two human
users, use
users/app
. Unable to add other apps to the space. - To add a human user, useusers/
user, where
usercan be the email address for the user. For users in the same Workspace organization
usercan also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@ example.com` is `123456789`, you can add the user to the space by setting the ` membership.member.name` to `users/user@example.com` or `users/123456789`. - To add or invite a Google group in a named space, use `groups/`group
, wheregroup
is theid
for the group from the Cloud Identity Groups API. For example, you can use Cloud Identity Groups lookup API to retrieve the ID123456789
for group emailgroup@example.com
, then you can add or invite the group to a named space by setting themembership.group_member.name
togroups/123456789
. Group email is not supported, and Google groups can only be added as members in named spaces.
589 590 591 592 593 594 595 596 597 598 599 |
# File 'lib/google/apis/chat_v1/service.rb', line 589 def create_space_member(parent, membership_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/members', ) command.request_representation = Google::Apis::ChatV1::Membership::Representation command.request_object = membership_object command.response_representation = Google::Apis::ChatV1::Membership::Representation command.response_class = Google::Apis::ChatV1::Membership command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_space_message(parent, message_object = nil, message_id: nil, message_reply_option: nil, request_id: nil, thread_key: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Creates a message in a Google Chat space. The maximum message size, including text and cards, is 32,000 bytes. For an example, see Send a message. Calling this method requires authentication and supports the following authentication types: - For text messages, user authentication or app authentication are supported. - For card messages, only app authentication is supported. (Only Chat apps can create card messages.)
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 |
# File 'lib/google/apis/chat_v1/service.rb', line 863 def (parent, = nil, message_id: nil, message_reply_option: nil, request_id: nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/messages', ) 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['messageId'] = unless .nil? command.query['messageReplyOption'] = unless .nil? command.query['requestId'] = request_id unless request_id.nil? command.query['threadKey'] = thread_key unless thread_key.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_space_message_reaction(parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Reaction
Creates a reaction and adds it to a message. Only unicode emojis are supported. For an example, see Add a reaction to a message. Requires user authentication.
1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 |
# File 'lib/google/apis/chat_v1/service.rb', line 1233 def (parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/reactions', ) command.request_representation = Google::Apis::ChatV1::Reaction::Representation command.request_object = reaction_object command.response_representation = Google::Apis::ChatV1::Reaction::Representation command.response_class = Google::Apis::ChatV1::Reaction command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_space(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty
Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see Delete a space. Requires user authentication from a user who has permission to delete the space.
247 248 249 250 251 252 253 254 255 |
# File 'lib/google/apis/chat_v1/service.rb', line 247 def delete_space(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 |
#delete_space_member(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Deletes a membership. For an example, see Remove a user or a Google Chat app from a space. Requires user authentication.
632 633 634 635 636 637 638 639 640 |
# File 'lib/google/apis/chat_v1/service.rb', line 632 def delete_space_member(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, '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 |
#delete_space_message(name, force: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty
Deletes a message. For an example, see Delete a message. Requires authentication. Supports app authentication and user authentication. When using app authentication, requests can only delete messages created by the calling Chat app.
917 918 919 920 921 922 923 924 925 926 |
# File 'lib/google/apis/chat_v1/service.rb', line 917 def (name, force: nil, 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['force'] = force unless force.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_space_message_reaction(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Empty
Deletes a reaction to a message. Only unicode emojis are supported. For an example, see Delete a reaction. Requires user authentication.
1269 1270 1271 1272 1273 1274 1275 1276 1277 |
# File 'lib/google/apis/chat_v1/service.rb', line 1269 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
.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/google/apis/chat_v1/service.rb', line 78 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 |
#find_space_direct_message(name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Returns the existing direct message with the specified user. If no direct
message space is found, returns a 404 NOT_FOUND
error. For an example, see
Find a direct message. With
user authentication, returns the direct message space between the specified
user and the authenticated user. With app authentication, returns the direct
message space between the specified user and the calling Chat app. Requires
user authentication or app authentication.
296 297 298 299 300 301 302 303 304 |
# File 'lib/google/apis/chat_v1/service.rb', line 296 def (name: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/spaces:findDirectMessage', ) command.response_representation = Google::Apis::ChatV1::Space::Representation command.response_class = Google::Apis::ChatV1::Space command.query['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_space(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Returns details about a space. For an example, see Get details about a space. Requires authentication. Supports app authentication and user authentication.
332 333 334 335 336 337 338 339 340 |
# File 'lib/google/apis/chat_v1/service.rb', line 332 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 details about a membership. For an example, see Get details about a user's or Google Chat app's membership. Requires authentication. Supports app authentication and user authentication.
676 677 678 679 680 681 682 683 684 |
# File 'lib/google/apis/chat_v1/service.rb', line 676 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 details about a message. For an example, see Get details about a message. Requires authentication. Supports app authentication and user authentication. Note: Might return a message from a blocked member or space.
958 959 960 961 962 963 964 965 966 |
# File 'lib/google/apis/chat_v1/service.rb', line 958 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. For an example, see Get metadata about a message attachment. Requires app authentication.
1198 1199 1200 1201 1202 1203 1204 1205 1206 |
# File 'lib/google/apis/chat_v1/service.rb', line 1198 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 |
#get_space_space_event(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceEvent
Returns an event from a Google Chat space. The event payload contains the most recent version of the
resource that changed. For example, if you request an event about a new
message but the message was later updated, the server returns the updated
Message
resource in the event payload. Requires user authentication. To get
an event, the authenticated user must be a member of the space. For an example,
see Get details about an event from a Google Chat space.
1376 1377 1378 1379 1380 1381 1382 1383 1384 |
# File 'lib/google/apis/chat_v1/service.rb', line 1376 def get_space_space_event(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::ChatV1::SpaceEvent::Representation command.response_class = Google::Apis::ChatV1::SpaceEvent command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_user_space_space_read_state(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceReadState
Returns details about a user's read state within a space, used to identify read and unread messages. For an example, see Get details about a user's space read state. Requires user authentication.
1496 1497 1498 1499 1500 1501 1502 1503 1504 |
# File 'lib/google/apis/chat_v1/service.rb', line 1496 def get_user_space_space_read_state(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::ChatV1::SpaceReadState::Representation command.response_class = Google::Apis::ChatV1::SpaceReadState command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_user_space_thread_thread_read_state(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ThreadReadState
Returns details about a user's read state within a thread, used to identify read and unread messages. For an example, see Get details about a user's thread read state. Requires user authentication.
1585 1586 1587 1588 1589 1590 1591 1592 1593 |
# File 'lib/google/apis/chat_v1/service.rb', line 1585 def get_user_space_thread_thread_read_state(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::ChatV1::ThreadReadState::Representation command.response_class = Google::Apis::ChatV1::ThreadReadState command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_space_members(parent, filter: nil, page_size: nil, page_token: nil, show_groups: nil, show_invited: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListMembershipsResponse
Lists memberships in a space. For an example, see List users and Google Chat apps in a space. Listing memberships with app authentication lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with User authentication lists memberships in spaces that the authenticated user has access to. Requires authentication. Supports app authentication and user authentication.
756 757 758 759 760 761 762 763 764 765 766 767 768 769 |
# File 'lib/google/apis/chat_v1/service.rb', line 756 def list_space_members(parent, filter: nil, page_size: nil, page_token: nil, show_groups: nil, show_invited: 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['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['showGroups'] = show_groups unless show_groups.nil? command.query['showInvited'] = show_invited unless show_invited.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_space_message_reactions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListReactionsResponse
Lists reactions to a message. For an example, see List reactions for a message. Requires user authentication.
1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 |
# File 'lib/google/apis/chat_v1/service.rb', line 1333 def (parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/reactions', ) command.response_representation = Google::Apis::ChatV1::ListReactionsResponse::Representation command.response_class = Google::Apis::ChatV1::ListReactionsResponse command.params['parent'] = parent unless parent.nil? command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_space_messages(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListMessagesResponse
Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. For an example, see List messages. Requires user authentication.
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 |
# File 'lib/google/apis/chat_v1/service.rb', line 1029 def (parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/messages', ) command.response_representation = Google::Apis::ChatV1::ListMessagesResponse::Representation command.response_class = Google::Apis::ChatV1::ListMessagesResponse command.params['parent'] = parent unless parent.nil? command.query['filter'] = filter unless filter.nil? command.query['orderBy'] = order_by unless order_by.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['showDeleted'] = show_deleted unless show_deleted.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_space_space_events(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSpaceEventsResponse
Lists events from a Google Chat space. For each event, the payload contains the most recent version of the Chat
resource. For example, if you list events about new space members, the server
returns Membership
resources that contain the latest membership details. If
new members were removed during the requested period, the event payload
contains an empty Membership
resource. Requires user authentication. To
list events, the authenticated user must be a member of the space. For an
example, see List events from a Google Chat space.
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 |
# File 'lib/google/apis/chat_v1/service.rb', line 1453 def list_space_space_events(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/spaceEvents', ) command.response_representation = Google::Apis::ChatV1::ListSpaceEventsResponse::Representation command.response_class = Google::Apis::ChatV1::ListSpaceEventsResponse command.params['parent'] = parent unless parent.nil? command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::ListSpacesResponse
Lists spaces the caller is a member of. Group chats and DMs aren't listed
until the first message is sent. For an example, see List spaces. Requires authentication. Supports
app authentication and user authentication. Lists spaces visible to the
caller or authenticated user. Group chats and DMs aren't listed until the
first message is sent. To list all named spaces by Google Workspace
organization, use the spaces.search()
method using Workspace
administrator privileges instead.
390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/google/apis/chat_v1/service.rb', line 390 def list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/spaces', ) command.response_representation = Google::Apis::ChatV1::ListSpacesResponse::Representation command.response_class = Google::Apis::ChatV1::ListSpacesResponse command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_space(name, space_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Updates a space. For an example, see Update a space. If you're updating the displayName
field and receive the error message ALREADY_EXISTS
, try a different display
name.. An existing space within the Google Workspace organization might
already use this display name. Requires user authentication.
463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/google/apis/chat_v1/service.rb', line 463 def patch_space(name, space_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::ChatV1::Space::Representation command.request_object = space_object command.response_representation = Google::Apis::ChatV1::Space::Representation command.response_class = Google::Apis::ChatV1::Space command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_space_member(name, membership_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Membership
Updates a membership. For an example, see Update a user's membership in a space. Requires user authentication.
799 800 801 802 803 804 805 806 807 808 809 810 |
# File 'lib/google/apis/chat_v1/service.rb', line 799 def patch_space_member(name, membership_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::ChatV1::Membership::Representation command.request_object = membership_object command.response_representation = Google::Apis::ChatV1::Membership::Representation command.response_class = Google::Apis::ChatV1::Membership command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Updates a message. There's a difference between the patch
and update
methods. The patch
method uses a patch
request while the update
method
uses a put
request. We recommend using the patch
method. For an example,
see Update a message. Requires authentication. Supports app authentication and user
authentication. When using app authentication, requests can only update
messages created by the calling Chat app.
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 |
# File 'lib/google/apis/chat_v1/service.rb', line 1094 def (name, = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, '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['allowMissing'] = allow_missing unless allow_missing.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Space
Creates a space and adds specified users to it. The calling user is
automatically added to the space, and shouldn't be specified as a membership
in the request. For an example, see Set up a space with initial members. To specify the
human members to add, add memberships with the appropriate membership.member.
name
. To add a human user, use users/
user, where
usercan be the
email address for the user. For users in the same Workspace organization
usercan also be the `id` for the person from the People API, or the `id`
for the user in the Directory API. For example, if the People API Person
profile ID for `user@example.com` is `123456789`, you can add the user to the
space by setting the `membership.member.name` to `users/user@example.com` or `
users/123456789`. To specify the Google groups to add, add memberships with
the appropriate `membership.group_member.name`. To add or invite a Google
group, use `groups/`group
, where group
is the id
for the group from
the Cloud Identity Groups API. For example, you can use Cloud Identity Groups
lookup API to retrieve the ID 123456789
for group email group@example.com
,
then you can add the group to the space by setting the membership.
group_member.name
to groups/123456789
. Group email is not supported, and
Google groups can only be added as members in named spaces. For a named space
or group chat, if the caller blocks, or is blocked by some members, or doesn't
have permission to add some members, then those members aren't added to the
created space. To create a direct message (DM) between the calling user and
another human user, specify exactly one membership to represent the human user.
If one user blocks the other, the request fails and the DM isn't created. To
create a DM between the calling user and the calling app, set Space.
singleUserBotDm
to true
and don't specify any memberships. You can only use
this method to set up a DM with the calling app. To add the calling app as a
member of a space or an existing DM between two human users, see Invite or
add a user or app to a space. If a DM already exists between two users, even when one user
blocks the other at the time a request is made, then the existing DM is
returned. Spaces with threaded replies aren't supported. If you receive the
error message ALREADY_EXISTS
when setting up a space, try a different
displayName
. An existing space within the Google Workspace organization might
already use this display name. Requires user authentication.
531 532 533 534 535 536 537 538 539 540 |
# File 'lib/google/apis/chat_v1/service.rb', line 531 def setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/spaces:setup', ) command.request_representation = Google::Apis::ChatV1::SetUpSpaceRequest::Representation command.request_object = set_up_space_request_object command.response_representation = Google::Apis::ChatV1::Space::Representation command.response_class = Google::Apis::ChatV1::Space command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::Message
Updates a message. There's a difference between the patch
and update
methods. The patch
method uses a patch
request while the update
method
uses a put
request. We recommend using the patch
method. For an example,
see Update a message. Requires authentication. Supports app authentication and user
authentication. When using app authentication, requests can only update
messages created by the calling Chat app.
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 |
# File 'lib/google/apis/chat_v1/service.rb', line 1158 def (name, = nil, allow_missing: 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['allowMissing'] = allow_missing unless allow_missing.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_user_space_space_read_state(name, space_read_state_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::SpaceReadState
Updates a user's read state within a space, used to identify read and unread messages. For an example, see Update a user's space read state. Requires user authentication.
1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 |
# File 'lib/google/apis/chat_v1/service.rb', line 1541 def update_user_space_space_read_state(name, space_read_state_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::ChatV1::SpaceReadState::Representation command.request_object = space_read_state_object command.response_representation = Google::Apis::ChatV1::SpaceReadState::Representation command.response_class = Google::Apis::ChatV1::SpaceReadState command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#upload_medium_attachment(parent, upload_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ChatV1::UploadAttachmentResponse
Uploads an attachment. For an example, see Upload media as a file attachment. Requires user authentication. You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/google/apis/chat_v1/service.rb', line 125 def (parent, = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block) if upload_source.nil? command = make_simple_command(:post, 'v1/{+parent}/attachments:upload', ) else command = make_upload_command(:post, 'v1/{+parent}/attachments:upload', ) command.upload_source = upload_source command.upload_content_type = content_type end command.request_representation = Google::Apis::ChatV1::UploadAttachmentRequest::Representation command.request_object = command.response_representation = Google::Apis::ChatV1::UploadAttachmentResponse::Representation command.response_class = Google::Apis::ChatV1::UploadAttachmentResponse command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |