google-apis-chat_v1 0.57.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/google/apis/chat_v1/classes.rb +942 -360
- data/lib/google/apis/chat_v1/gem_version.rb +2 -2
- data/lib/google/apis/chat_v1/representations.rb +239 -0
- data/lib/google/apis/chat_v1/service.rb +686 -56
- data/lib/google/apis/chat_v1.rb +18 -0
- metadata +3 -3
@@ -88,6 +88,174 @@ module Google
|
|
88
88
|
execute_or_queue_command(command, &block)
|
89
89
|
end
|
90
90
|
|
91
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Uploads
|
92
|
+
# an attachment. Requires user [authentication](https://developers.google.com/
|
93
|
+
# chat/api/guides/auth/users). You can upload attachments up to 200 MB. Certain
|
94
|
+
# file types aren't supported. For details, see [File types blocked by Google
|
95
|
+
# Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%
|
96
|
+
# 3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
|
97
|
+
# @param [String] parent
|
98
|
+
# Required. Resource name of the Chat space in which the attachment is uploaded.
|
99
|
+
# Format "spaces/`space`".
|
100
|
+
# @param [Google::Apis::ChatV1::UploadAttachmentRequest] upload_attachment_request_object
|
101
|
+
# @param [String] fields
|
102
|
+
# Selector specifying which fields to include in a partial response.
|
103
|
+
# @param [String] quota_user
|
104
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
105
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
106
|
+
# @param [IO, String] upload_source
|
107
|
+
# IO stream or filename containing content to upload
|
108
|
+
# @param [String] content_type
|
109
|
+
# Content type of the uploaded content.
|
110
|
+
# @param [Google::Apis::RequestOptions] options
|
111
|
+
# Request-specific options
|
112
|
+
#
|
113
|
+
# @yield [result, err] Result & error if block supplied
|
114
|
+
# @yieldparam result [Google::Apis::ChatV1::UploadAttachmentResponse] parsed result object
|
115
|
+
# @yieldparam err [StandardError] error object if request failed
|
116
|
+
#
|
117
|
+
# @return [Google::Apis::ChatV1::UploadAttachmentResponse]
|
118
|
+
#
|
119
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
120
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
121
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
122
|
+
def upload_medium_attachment(parent, upload_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
|
123
|
+
if upload_source.nil?
|
124
|
+
command = make_simple_command(:post, 'v1/{+parent}/attachments:upload', options)
|
125
|
+
else
|
126
|
+
command = make_upload_command(:post, 'v1/{+parent}/attachments:upload', options)
|
127
|
+
command.upload_source = upload_source
|
128
|
+
command.upload_content_type = content_type
|
129
|
+
end
|
130
|
+
command.request_representation = Google::Apis::ChatV1::UploadAttachmentRequest::Representation
|
131
|
+
command.request_object = upload_attachment_request_object
|
132
|
+
command.response_representation = Google::Apis::ChatV1::UploadAttachmentResponse::Representation
|
133
|
+
command.response_class = Google::Apis::ChatV1::UploadAttachmentResponse
|
134
|
+
command.params['parent'] = parent unless parent.nil?
|
135
|
+
command.query['fields'] = fields unless fields.nil?
|
136
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
137
|
+
execute_or_queue_command(command, &block)
|
138
|
+
end
|
139
|
+
|
140
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Creates
|
141
|
+
# a named space. Spaces grouped by topics or that have guest access aren't
|
142
|
+
# supported. Requires [user authentication](https://developers.google.com/chat/
|
143
|
+
# api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
144
|
+
# @param [Google::Apis::ChatV1::Space] space_object
|
145
|
+
# @param [String] request_id
|
146
|
+
# Optional. A unique identifier for this request. A random UUID is recommended.
|
147
|
+
# Specifying an existing request ID returns the space created with that ID
|
148
|
+
# instead of creating a new space. Specifying an existing request ID from the
|
149
|
+
# same Chat app with a different authenticated user returns an error.
|
150
|
+
# @param [String] fields
|
151
|
+
# Selector specifying which fields to include in a partial response.
|
152
|
+
# @param [String] quota_user
|
153
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
154
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
155
|
+
# @param [Google::Apis::RequestOptions] options
|
156
|
+
# Request-specific options
|
157
|
+
#
|
158
|
+
# @yield [result, err] Result & error if block supplied
|
159
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
160
|
+
# @yieldparam err [StandardError] error object if request failed
|
161
|
+
#
|
162
|
+
# @return [Google::Apis::ChatV1::Space]
|
163
|
+
#
|
164
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
165
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
166
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
167
|
+
def create_space(space_object = nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
|
168
|
+
command = make_simple_command(:post, 'v1/spaces', options)
|
169
|
+
command.request_representation = Google::Apis::ChatV1::Space::Representation
|
170
|
+
command.request_object = space_object
|
171
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
172
|
+
command.response_class = Google::Apis::ChatV1::Space
|
173
|
+
command.query['requestId'] = request_id unless request_id.nil?
|
174
|
+
command.query['fields'] = fields unless fields.nil?
|
175
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
176
|
+
execute_or_queue_command(command, &block)
|
177
|
+
end
|
178
|
+
|
179
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Deletes
|
180
|
+
# a named space. Always performs a cascading delete, which means that the space'
|
181
|
+
# s child resources—like messages posted in the space and memberships in the
|
182
|
+
# space—are also deleted. Requires [user authentication](https://developers.
|
183
|
+
# google.com/chat/api/guides/auth/users) from a user who has permission to
|
184
|
+
# delete the space, and the `chat.delete` scope.
|
185
|
+
# @param [String] name
|
186
|
+
# Required. Resource name of the space to delete. Format: `spaces/`space``
|
187
|
+
# @param [String] fields
|
188
|
+
# Selector specifying which fields to include in a partial response.
|
189
|
+
# @param [String] quota_user
|
190
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
191
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
192
|
+
# @param [Google::Apis::RequestOptions] options
|
193
|
+
# Request-specific options
|
194
|
+
#
|
195
|
+
# @yield [result, err] Result & error if block supplied
|
196
|
+
# @yieldparam result [Google::Apis::ChatV1::Empty] parsed result object
|
197
|
+
# @yieldparam err [StandardError] error object if request failed
|
198
|
+
#
|
199
|
+
# @return [Google::Apis::ChatV1::Empty]
|
200
|
+
#
|
201
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
202
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
203
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
204
|
+
def delete_space(name, fields: nil, quota_user: nil, options: nil, &block)
|
205
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
206
|
+
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
207
|
+
command.response_class = Google::Apis::ChatV1::Empty
|
208
|
+
command.params['name'] = name unless name.nil?
|
209
|
+
command.query['fields'] = fields unless fields.nil?
|
210
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
211
|
+
execute_or_queue_command(command, &block)
|
212
|
+
end
|
213
|
+
|
214
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Returns
|
215
|
+
# the existing direct message with the specified user. With [user authentication]
|
216
|
+
# (https://developers.google.com/chat/api/guides/auth/users), returns the direct
|
217
|
+
# message space between the specified user and the authenticated user. With [
|
218
|
+
# service account authentication](https://developers.google.com/chat/api/guides/
|
219
|
+
# auth/service-accounts), returns the direct message space between the specified
|
220
|
+
# user and the calling Chat app. If no direct message space is found, returns a `
|
221
|
+
# 404 NOT_FOUND` error. Requires [user authentication](https://developers.google.
|
222
|
+
# com/chat/api/guides/auth/users) or [service account authentication](https://
|
223
|
+
# developers.google.com/chat/api/guides/auth/service-accounts).
|
224
|
+
# @param [String] name
|
225
|
+
# Required. Resource name of the user to find direct message with. Format: `
|
226
|
+
# users/`user``, where ``user`` is either the ``person_id`` for the [person](
|
227
|
+
# https://developers.google.com/people/api/rest/v1/people) from the People API,
|
228
|
+
# or the `id` for the [user](https://developers.google.com/admin-sdk/directory/
|
229
|
+
# reference/rest/v1/users) in the Directory API. For example, if the People API `
|
230
|
+
# Person.resourceName` is `people/123456789`, you can find a direct message with
|
231
|
+
# that person by using `users/123456789` as the `name`.
|
232
|
+
# @param [String] fields
|
233
|
+
# Selector specifying which fields to include in a partial response.
|
234
|
+
# @param [String] quota_user
|
235
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
236
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
237
|
+
# @param [Google::Apis::RequestOptions] options
|
238
|
+
# Request-specific options
|
239
|
+
#
|
240
|
+
# @yield [result, err] Result & error if block supplied
|
241
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
242
|
+
# @yieldparam err [StandardError] error object if request failed
|
243
|
+
#
|
244
|
+
# @return [Google::Apis::ChatV1::Space]
|
245
|
+
#
|
246
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
247
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
248
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
249
|
+
def find_space_direct_message(name: nil, fields: nil, quota_user: nil, options: nil, &block)
|
250
|
+
command = make_simple_command(:get, 'v1/spaces:findDirectMessage', options)
|
251
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
252
|
+
command.response_class = Google::Apis::ChatV1::Space
|
253
|
+
command.query['name'] = name unless name.nil?
|
254
|
+
command.query['fields'] = fields unless fields.nil?
|
255
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
256
|
+
execute_or_queue_command(command, &block)
|
257
|
+
end
|
258
|
+
|
91
259
|
# Returns a space. Requires [authentication](https://developers.google.com/chat/
|
92
260
|
# api/guides/auth). Fully supports [service account authentication](https://
|
93
261
|
# developers.google.com/chat/api/guides/auth/service-accounts). Supports [user
|
@@ -97,8 +265,8 @@ module Google
|
|
97
265
|
# User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
98
266
|
# requires the `chat.spaces` or `chat.spaces.readonly` authorization scope.
|
99
267
|
# @param [String] name
|
100
|
-
# Required. Resource name of the space, in the form "spaces/*". Format: spaces/`
|
101
|
-
# space
|
268
|
+
# Required. Resource name of the space, in the form "spaces/*". Format: `spaces/`
|
269
|
+
# space``
|
102
270
|
# @param [String] fields
|
103
271
|
# Selector specifying which fields to include in a partial response.
|
104
272
|
# @param [String] quota_user
|
@@ -137,16 +305,31 @@ module Google
|
|
137
305
|
# readonly` authorization scope. Lists spaces visible to the caller or
|
138
306
|
# authenticated user. Group chats and DMs aren't listed until the first message
|
139
307
|
# is sent.
|
308
|
+
# @param [String] filter
|
309
|
+
# Optional. A query filter. Requires [user authentication](https://developers.
|
310
|
+
# google.com/chat/api/guides/auth/users). You can filter spaces by the space
|
311
|
+
# type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/
|
312
|
+
# spaces#spacetype)). To filter by space type, you must specify valid enum value,
|
313
|
+
# such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `
|
314
|
+
# SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
|
315
|
+
# operator. For example, the following queries are valid: ``` space_type = "
|
316
|
+
# SPACE" spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" ``` Invalid
|
317
|
+
# queries are rejected by the server with an `INVALID_ARGUMENT` error. With [
|
318
|
+
# service account authentication](https://developers.google.com/chat/api/guides/
|
319
|
+
# auth/service-accounts), this field is ignored and the query always returns all
|
320
|
+
# spaces. But the Chat API still validates the query syntax with service
|
321
|
+
# accounts, so invalid queries are still rejected. [Developer Preview](https://
|
322
|
+
# developers.google.com/workspace/preview).
|
140
323
|
# @param [Fixnum] page_size
|
141
|
-
# Optional. The maximum number of spaces to return. The service
|
142
|
-
# than this value. If unspecified, at most 100 spaces are returned. The
|
143
|
-
# value is
|
144
|
-
# an `INVALID_ARGUMENT` error.
|
324
|
+
# Optional. The maximum number of spaces to return. The service might return
|
325
|
+
# fewer than this value. If unspecified, at most 100 spaces are returned. The
|
326
|
+
# maximum value is 1,000. If you use a value more than 1,000, it's automatically
|
327
|
+
# changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
145
328
|
# @param [String] page_token
|
146
329
|
# Optional. A page token, received from a previous list spaces call. Provide
|
147
|
-
# this to retrieve the subsequent page. When paginating, the filter
|
148
|
-
# match the call that provided the page token. Passing a different
|
149
|
-
# lead to unexpected results.
|
330
|
+
# this parameter to retrieve the subsequent page. When paginating, the filter
|
331
|
+
# value should match the call that provided the page token. Passing a different
|
332
|
+
# value may lead to unexpected results.
|
150
333
|
# @param [String] fields
|
151
334
|
# Selector specifying which fields to include in a partial response.
|
152
335
|
# @param [String] quota_user
|
@@ -164,10 +347,11 @@ module Google
|
|
164
347
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
165
348
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
166
349
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
167
|
-
def list_spaces(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
350
|
+
def list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
168
351
|
command = make_simple_command(:get, 'v1/spaces', options)
|
169
352
|
command.response_representation = Google::Apis::ChatV1::ListSpacesResponse::Representation
|
170
353
|
command.response_class = Google::Apis::ChatV1::ListSpacesResponse
|
354
|
+
command.query['filter'] = filter unless filter.nil?
|
171
355
|
command.query['pageSize'] = page_size unless page_size.nil?
|
172
356
|
command.query['pageToken'] = page_token unless page_token.nil?
|
173
357
|
command.query['fields'] = fields unless fields.nil?
|
@@ -175,6 +359,200 @@ module Google
|
|
175
359
|
execute_or_queue_command(command, &block)
|
176
360
|
end
|
177
361
|
|
362
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Updates
|
363
|
+
# a space. Requires [user authentication](https://developers.google.com/chat/api/
|
364
|
+
# guides/auth/users) and the `chat.spaces` scope.
|
365
|
+
# @param [String] name
|
366
|
+
# Resource name of the space. Format: `spaces/`space``
|
367
|
+
# @param [Google::Apis::ChatV1::Space] space_object
|
368
|
+
# @param [String] update_mask
|
369
|
+
# Required. The updated field paths, comma separated if there are multiple.
|
370
|
+
# Currently supported field paths: - `display_name` (Only supports changing the
|
371
|
+
# display name of a space with the `SPACE` type, or when also including the `
|
372
|
+
# space_type` mask to change a `GROUP_CHAT` space type to `SPACE`. Trying to
|
373
|
+
# update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space results
|
374
|
+
# in an invalid argument error.) - `space_type` (Only supports changing a `
|
375
|
+
# GROUP_CHAT` space type to `SPACE`. Include `display_name` together with `
|
376
|
+
# space_type` in the update mask and ensure that the specified space has a non-
|
377
|
+
# empty display name and the `SPACE` space type. Including the `space_type` mask
|
378
|
+
# and the `SPACE` type in the specified space when updating the display name is
|
379
|
+
# optional if the existing space already has the `SPACE` type. Trying to update
|
380
|
+
# the space type in other ways results in an invalid argument error). - `
|
381
|
+
# space_details` - `space_history_state` (Supports [turning history on or off
|
382
|
+
# for the space](https://support.google.com/chat/answer/7664687) if [the
|
383
|
+
# organization allows users to change their history setting](https://support.
|
384
|
+
# google.com/a/answer/7664184). Warning: mutually exclusive with all other field
|
385
|
+
# paths.)
|
386
|
+
# @param [String] fields
|
387
|
+
# Selector specifying which fields to include in a partial response.
|
388
|
+
# @param [String] quota_user
|
389
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
390
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
391
|
+
# @param [Google::Apis::RequestOptions] options
|
392
|
+
# Request-specific options
|
393
|
+
#
|
394
|
+
# @yield [result, err] Result & error if block supplied
|
395
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
396
|
+
# @yieldparam err [StandardError] error object if request failed
|
397
|
+
#
|
398
|
+
# @return [Google::Apis::ChatV1::Space]
|
399
|
+
#
|
400
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
401
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
402
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
403
|
+
def patch_space(name, space_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
404
|
+
command = make_simple_command(:patch, 'v1/{+name}', options)
|
405
|
+
command.request_representation = Google::Apis::ChatV1::Space::Representation
|
406
|
+
command.request_object = space_object
|
407
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
408
|
+
command.response_class = Google::Apis::ChatV1::Space
|
409
|
+
command.params['name'] = name unless name.nil?
|
410
|
+
command.query['updateMask'] = update_mask unless update_mask.nil?
|
411
|
+
command.query['fields'] = fields unless fields.nil?
|
412
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
413
|
+
execute_or_queue_command(command, &block)
|
414
|
+
end
|
415
|
+
|
416
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Creates
|
417
|
+
# a space and adds specified users to it. The calling user is automatically
|
418
|
+
# added to the space, and shouldn't be specified as a membership in the request.
|
419
|
+
# To specify the human members to add, add memberships with the appropriate `
|
420
|
+
# member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/`user`
|
421
|
+
# `, where ``user`` is either the ``person_id`` for the [person](https://
|
422
|
+
# developers.google.com/people/api/rest/v1/people) from the People API, or the `
|
423
|
+
# id` for the [user](https://developers.google.com/admin-sdk/directory/reference/
|
424
|
+
# rest/v1/users) in the Admin SDK Directory API. For example, if the People API `
|
425
|
+
# Person` `resourceName` is `people/123456789`, you can add the user to the
|
426
|
+
# space by including a membership with `users/123456789` as the `member.name`.
|
427
|
+
# For a space or group chat, if the caller blocks or is blocked by some members,
|
428
|
+
# then those members aren't added to the created space. To create a direct
|
429
|
+
# message (DM) between the calling user and another human user, specify exactly
|
430
|
+
# one membership to represent the human user. If one user blocks the other, the
|
431
|
+
# request fails and the DM isn't created. To create a DM between the calling
|
432
|
+
# user and the calling app, set `Space.singleUserBotDm` to true and don't
|
433
|
+
# specify any memberships. You can only use this method to add app memberships
|
434
|
+
# to DMs. To add the calling app as a member of other space types, use [create
|
435
|
+
# membership](https://developers.google.com/chat/api/reference/rest/v1/spaces.
|
436
|
+
# members/create) If a DM already exists between two users, even when one user
|
437
|
+
# blocks the other at the time a request is made, then the existing DM is
|
438
|
+
# returned. Spaces with threaded replies or guest access aren't supported.
|
439
|
+
# Requires [user authentication](https://developers.google.com/chat/api/guides/
|
440
|
+
# auth/users) and the `chat.spaces.create` or `chat.spaces` scope.
|
441
|
+
# @param [Google::Apis::ChatV1::SetUpSpaceRequest] set_up_space_request_object
|
442
|
+
# @param [String] fields
|
443
|
+
# Selector specifying which fields to include in a partial response.
|
444
|
+
# @param [String] quota_user
|
445
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
446
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
447
|
+
# @param [Google::Apis::RequestOptions] options
|
448
|
+
# Request-specific options
|
449
|
+
#
|
450
|
+
# @yield [result, err] Result & error if block supplied
|
451
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
452
|
+
# @yieldparam err [StandardError] error object if request failed
|
453
|
+
#
|
454
|
+
# @return [Google::Apis::ChatV1::Space]
|
455
|
+
#
|
456
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
457
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
458
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
459
|
+
def setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
460
|
+
command = make_simple_command(:post, 'v1/spaces:setup', options)
|
461
|
+
command.request_representation = Google::Apis::ChatV1::SetUpSpaceRequest::Representation
|
462
|
+
command.request_object = set_up_space_request_object
|
463
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
464
|
+
command.response_class = Google::Apis::ChatV1::Space
|
465
|
+
command.query['fields'] = fields unless fields.nil?
|
466
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
467
|
+
execute_or_queue_command(command, &block)
|
468
|
+
end
|
469
|
+
|
470
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Creates
|
471
|
+
# a human membership or app membership for the calling app. Creating memberships
|
472
|
+
# for other apps isn't supported. Requires [user authentication](https://
|
473
|
+
# developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (
|
474
|
+
# for human membership) or `chat.memberships.app` (for app membership) scope. To
|
475
|
+
# specify the member to add, set the `membership.member.name` in the `
|
476
|
+
# CreateMembershipRequest`: - To add the calling app to the space, use `users/
|
477
|
+
# app`. - To add a human user, use `users/`user``, where ``user`` is either the `
|
478
|
+
# `person_id`` for the [person](https://developers.google.com/people/api/rest/v1/
|
479
|
+
# people) from the People API, or the `id` for the [user](https://developers.
|
480
|
+
# google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API.
|
481
|
+
# For example, if the People API `Person` `resourceName` is `people/123456789`,
|
482
|
+
# you can add the user to the space by setting the `membership.member.name` to `
|
483
|
+
# users/123456789`.
|
484
|
+
# @param [String] parent
|
485
|
+
# Required. The resource name of the space for which to create the membership.
|
486
|
+
# Format: spaces/`space`
|
487
|
+
# @param [Google::Apis::ChatV1::Membership] membership_object
|
488
|
+
# @param [String] fields
|
489
|
+
# Selector specifying which fields to include in a partial response.
|
490
|
+
# @param [String] quota_user
|
491
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
492
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
493
|
+
# @param [Google::Apis::RequestOptions] options
|
494
|
+
# Request-specific options
|
495
|
+
#
|
496
|
+
# @yield [result, err] Result & error if block supplied
|
497
|
+
# @yieldparam result [Google::Apis::ChatV1::Membership] parsed result object
|
498
|
+
# @yieldparam err [StandardError] error object if request failed
|
499
|
+
#
|
500
|
+
# @return [Google::Apis::ChatV1::Membership]
|
501
|
+
#
|
502
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
503
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
504
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
505
|
+
def create_space_member(parent, membership_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
506
|
+
command = make_simple_command(:post, 'v1/{+parent}/members', options)
|
507
|
+
command.request_representation = Google::Apis::ChatV1::Membership::Representation
|
508
|
+
command.request_object = membership_object
|
509
|
+
command.response_representation = Google::Apis::ChatV1::Membership::Representation
|
510
|
+
command.response_class = Google::Apis::ChatV1::Membership
|
511
|
+
command.params['parent'] = parent unless parent.nil?
|
512
|
+
command.query['fields'] = fields unless fields.nil?
|
513
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
514
|
+
execute_or_queue_command(command, &block)
|
515
|
+
end
|
516
|
+
|
517
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Deletes
|
518
|
+
# a membership. Requires [user authentication](https://developers.google.com/
|
519
|
+
# chat/api/guides/auth/users) and the `chat.memberships` or `chat.memberships.
|
520
|
+
# app` authorization scope.
|
521
|
+
# @param [String] name
|
522
|
+
# Required. Resource name of the membership to delete. Chat apps can delete
|
523
|
+
# human users' or their own memberships. Chat apps can't delete other apps'
|
524
|
+
# memberships. When deleting a human membership, requires the `chat.memberships`
|
525
|
+
# scope and `spaces/`space`/members/`member`` format. When deleting an app
|
526
|
+
# membership, requires the `chat.memberships.app` scope and `spaces/`space`/
|
527
|
+
# members/app` format. Format: `spaces/`space`/members/`member`` or `spaces/`
|
528
|
+
# space`/members/app`
|
529
|
+
# @param [String] fields
|
530
|
+
# Selector specifying which fields to include in a partial response.
|
531
|
+
# @param [String] quota_user
|
532
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
533
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
534
|
+
# @param [Google::Apis::RequestOptions] options
|
535
|
+
# Request-specific options
|
536
|
+
#
|
537
|
+
# @yield [result, err] Result & error if block supplied
|
538
|
+
# @yieldparam result [Google::Apis::ChatV1::Membership] parsed result object
|
539
|
+
# @yieldparam err [StandardError] error object if request failed
|
540
|
+
#
|
541
|
+
# @return [Google::Apis::ChatV1::Membership]
|
542
|
+
#
|
543
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
544
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
545
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
546
|
+
def delete_space_member(name, fields: nil, quota_user: nil, options: nil, &block)
|
547
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
548
|
+
command.response_representation = Google::Apis::ChatV1::Membership::Representation
|
549
|
+
command.response_class = Google::Apis::ChatV1::Membership
|
550
|
+
command.params['name'] = name unless name.nil?
|
551
|
+
command.query['fields'] = fields unless fields.nil?
|
552
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
553
|
+
execute_or_queue_command(command, &block)
|
554
|
+
end
|
555
|
+
|
178
556
|
# Returns a membership. Requires [authentication](https://developers.google.com/
|
179
557
|
# chat/api/guides/auth/). Fully supports [service account authentication](https:/
|
180
558
|
# /developers.google.com/chat/api/guides/auth/service-accounts). Supports [user
|
@@ -185,8 +563,8 @@ module Google
|
|
185
563
|
# requires the `chat.memberships` or `chat.memberships.readonly` authorization
|
186
564
|
# scope.
|
187
565
|
# @param [String] name
|
188
|
-
# Required. Resource name of the membership to retrieve. Format: spaces/`space`/
|
189
|
-
# members/`member
|
566
|
+
# Required. Resource name of the membership to retrieve. Format: `spaces/`space`/
|
567
|
+
# members/`member``
|
190
568
|
# @param [String] fields
|
191
569
|
# Selector specifying which fields to include in a partial response.
|
192
570
|
# @param [String] quota_user
|
@@ -226,16 +604,36 @@ module Google
|
|
226
604
|
# @param [String] parent
|
227
605
|
# Required. The resource name of the space for which to fetch a membership list.
|
228
606
|
# Format: spaces/`space`
|
607
|
+
# @param [String] filter
|
608
|
+
# Optional. A query filter. You can filter memberships by a member's role ([`
|
609
|
+
# role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#
|
610
|
+
# membershiprole)) and type ([`member.type`](https://developers.google.com/chat/
|
611
|
+
# api/reference/rest/v1/User#type)). To filter by role, set `role` to `
|
612
|
+
# ROLE_MEMBER` or `ROLE_MANAGER`. To filter by type, set `member.type` to `HUMAN`
|
613
|
+
# or `BOT`. To filter by both role and type, use the `AND` operator. To filter
|
614
|
+
# by either role or type, use the `OR` operator. For example, the following
|
615
|
+
# queries are valid: ``` role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" member.
|
616
|
+
# type = "HUMAN" AND role = "ROLE_MANAGER" ``` The following queries are invalid:
|
617
|
+
# ``` member.type = "HUMAN" AND member.type = "BOT" role = "ROLE_MANAGER" AND
|
618
|
+
# role = "ROLE_MEMBER" ``` Invalid queries are rejected by the server with an `
|
619
|
+
# INVALID_ARGUMENT` error.
|
229
620
|
# @param [Fixnum] page_size
|
230
|
-
# The maximum number of memberships to return. The service
|
231
|
-
# this value. If unspecified, at most 100 memberships are returned. The
|
232
|
-
# value is
|
233
|
-
# an INVALID_ARGUMENT error.
|
621
|
+
# The maximum number of memberships to return. The service might return fewer
|
622
|
+
# than this value. If unspecified, at most 100 memberships are returned. The
|
623
|
+
# maximum value is 1,000. If you use a value more than 1,000, it's automatically
|
624
|
+
# changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
234
625
|
# @param [String] page_token
|
235
626
|
# A page token, received from a previous call to list memberships. Provide this
|
236
|
-
# to retrieve the subsequent page. When paginating, all other
|
237
|
-
# provided should match the call that provided the page token.
|
238
|
-
# values to the other parameters
|
627
|
+
# parameter to retrieve the subsequent page. When paginating, all other
|
628
|
+
# parameters provided should match the call that provided the page token.
|
629
|
+
# Passing different values to the other parameters might lead to unexpected
|
630
|
+
# results.
|
631
|
+
# @param [Boolean] show_invited
|
632
|
+
# Optional. When `true`, also returns memberships associated with invited
|
633
|
+
# members, in addition to other types of memberships. If a filter is set,
|
634
|
+
# invited memberships that don't match the filter criteria aren't returned.
|
635
|
+
# Currently requires [user authentication](https://developers.google.com/chat/
|
636
|
+
# api/guides/auth/users).
|
239
637
|
# @param [String] fields
|
240
638
|
# Selector specifying which fields to include in a partial response.
|
241
639
|
# @param [String] quota_user
|
@@ -253,13 +651,15 @@ module Google
|
|
253
651
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
254
652
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
255
653
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
256
|
-
def list_space_members(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
654
|
+
def list_space_members(parent, filter: nil, page_size: nil, page_token: nil, show_invited: nil, fields: nil, quota_user: nil, options: nil, &block)
|
257
655
|
command = make_simple_command(:get, 'v1/{+parent}/members', options)
|
258
656
|
command.response_representation = Google::Apis::ChatV1::ListMembershipsResponse::Representation
|
259
657
|
command.response_class = Google::Apis::ChatV1::ListMembershipsResponse
|
260
658
|
command.params['parent'] = parent unless parent.nil?
|
659
|
+
command.query['filter'] = filter unless filter.nil?
|
261
660
|
command.query['pageSize'] = page_size unless page_size.nil?
|
262
661
|
command.query['pageToken'] = page_token unless page_token.nil?
|
662
|
+
command.query['showInvited'] = show_invited unless show_invited.nil?
|
263
663
|
command.query['fields'] = fields unless fields.nil?
|
264
664
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
265
665
|
execute_or_queue_command(command, &block)
|
@@ -280,7 +680,7 @@ module Google
|
|
280
680
|
# webhooks can create messages without a service account or user authentication.
|
281
681
|
# @param [String] parent
|
282
682
|
# Required. The resource name of the space in which to create a message. Format:
|
283
|
-
# spaces/`space
|
683
|
+
# `spaces/`space``
|
284
684
|
# @param [Google::Apis::ChatV1::Message] message_object
|
285
685
|
# @param [String] message_id
|
286
686
|
# Optional. A custom name for a Chat message assigned at creation. Must start
|
@@ -345,8 +745,15 @@ module Google
|
|
345
745
|
# https://developers.google.com/chat/api/guides/auth/users) requires the `chat.
|
346
746
|
# messages` authorization scope.
|
347
747
|
# @param [String] name
|
348
|
-
# Required. Resource name of the message to
|
349
|
-
# messages
|
748
|
+
# Required. Resource name of the message that you want to delete, in the form `
|
749
|
+
# spaces/*/messages/*` Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.
|
750
|
+
# BBBBBBBBBBB`
|
751
|
+
# @param [Boolean] force
|
752
|
+
# When `true`, deleting a message also deletes its threaded replies. When `false`
|
753
|
+
# , if a message has threaded replies, deletion fails. Only applies when [
|
754
|
+
# authenticating as a user](https://developers.google.com/chat/api/guides/auth/
|
755
|
+
# users). Has no effect when [authenticating with a service account] (https://
|
756
|
+
# developers.google.com/chat/api/guides/auth/service-accounts).
|
350
757
|
# @param [String] fields
|
351
758
|
# Selector specifying which fields to include in a partial response.
|
352
759
|
# @param [String] quota_user
|
@@ -364,11 +771,12 @@ module Google
|
|
364
771
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
365
772
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
366
773
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
367
|
-
def delete_space_message(name, fields: nil, quota_user: nil, options: nil, &block)
|
774
|
+
def delete_space_message(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
|
368
775
|
command = make_simple_command(:delete, 'v1/{+name}', options)
|
369
776
|
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
370
777
|
command.response_class = Google::Apis::ChatV1::Empty
|
371
778
|
command.params['name'] = name unless name.nil?
|
779
|
+
command.query['force'] = force unless force.nil?
|
372
780
|
command.query['fields'] = fields unless fields.nil?
|
373
781
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
374
782
|
execute_or_queue_command(command, &block)
|
@@ -386,8 +794,8 @@ module Google
|
|
386
794
|
# messages` or `chat.messages.readonly` authorization scope. Note: Might return
|
387
795
|
# a message from a blocked member or space.
|
388
796
|
# @param [String] name
|
389
|
-
# Required. Resource name of the message to retrieve. Format: spaces/`space`/
|
390
|
-
# messages/`message
|
797
|
+
# Required. Resource name of the message to retrieve. Format: `spaces/`space`/
|
798
|
+
# messages/`message`` If the message begins with `client-`, then it has a custom
|
391
799
|
# name assigned by a Chat app that created it with the Chat REST API. That Chat
|
392
800
|
# app (but not others) can pass the custom name to get, update, or delete the
|
393
801
|
# message. To learn more, see [create and name a message] (https://developers.
|
@@ -419,29 +827,109 @@ module Google
|
|
419
827
|
execute_or_queue_command(command, &block)
|
420
828
|
end
|
421
829
|
|
422
|
-
#
|
423
|
-
#
|
424
|
-
# Requires [authentication](https://developers.
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
830
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Lists
|
831
|
+
# messages in a space that the caller is a member of, including messages from
|
832
|
+
# blocked members and spaces. Requires [user authentication](https://developers.
|
833
|
+
# google.com/chat/api/guides/auth/users) and the `chat.messages` or `chat.
|
834
|
+
# messages.readonly` authorization scope. This method is only supported in
|
835
|
+
# spaces that don't allow users from outside the Workspace organization to join.
|
836
|
+
# @param [String] parent
|
837
|
+
# Required. The resource name of the space to list messages from. Format: `
|
838
|
+
# spaces/`space``
|
839
|
+
# @param [String] filter
|
840
|
+
# A query filter. You can filter messages by date (`create_time`) and thread (`
|
841
|
+
# thread.name`). To filter messages by the date they were created, specify the `
|
842
|
+
# create_time` with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/
|
843
|
+
# rfc3339) format and double quotation marks. For example, `"2023-04-21T11:30:00-
|
844
|
+
# 04:00"`. You can use the greater than operator `>` to list messages that were
|
845
|
+
# created after a timestamp, or the less than operator `<` to list messages that
|
846
|
+
# were created before a timestamp. To filter messages within a time interval,
|
847
|
+
# use the `AND` operator between two timestamps. To filter by thread, specify
|
848
|
+
# the `thread.name`, formatted as `spaces/`space`/threads/`thread``. You can
|
849
|
+
# only specify one `thread.name` per query. To filter by both thread and date,
|
850
|
+
# use the `AND` operator in your query. For example, the following queries are
|
851
|
+
# valid: ``` create_time > "2012-04-21T11:30:00-04:00" create_time > "2012-04-
|
852
|
+
# 21T11:30:00-04:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123
|
853
|
+
# create_time > "2012-04-21T11:30:00+00:00" AND create_time < "2013-01-01T00:00:
|
854
|
+
# 00+00:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123 thread.name =
|
855
|
+
# spaces/AAAAAAAAAAA/threads/123 ``` Invalid queries are rejected by the server
|
856
|
+
# with an `INVALID_ARGUMENT` error.
|
857
|
+
# @param [String] order_by
|
858
|
+
# Optional, if resuming from a previous query. How the list of messages is
|
859
|
+
# ordered. Specify a value to order by an ordering operation. Valid ordering
|
860
|
+
# operation values are as follows: - `ASC` for ascending. - `DESC` for
|
861
|
+
# descending. The default ordering is `create_time ASC`.
|
862
|
+
# @param [Fixnum] page_size
|
863
|
+
# The maximum number of messages returned. The service might return fewer
|
864
|
+
# messages than this value. If unspecified, at most 25 are returned. The maximum
|
865
|
+
# value is 1,000. If you use a value more than 1,000, it's automatically changed
|
866
|
+
# to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
867
|
+
# @param [String] page_token
|
868
|
+
# Optional, if resuming from a previous query. A page token received from a
|
869
|
+
# previous list messages call. Provide this parameter to retrieve the subsequent
|
870
|
+
# page. When paginating, all other parameters provided should match the call
|
871
|
+
# that provided the page token. Passing different values to the other parameters
|
872
|
+
# might lead to unexpected results.
|
873
|
+
# @param [Boolean] show_deleted
|
874
|
+
# Whether to include deleted messages. Deleted messages include deleted time and
|
875
|
+
# metadata about their deletion, but message content is unavailable.
|
876
|
+
# @param [String] fields
|
877
|
+
# Selector specifying which fields to include in a partial response.
|
878
|
+
# @param [String] quota_user
|
879
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
880
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
881
|
+
# @param [Google::Apis::RequestOptions] options
|
882
|
+
# Request-specific options
|
883
|
+
#
|
884
|
+
# @yield [result, err] Result & error if block supplied
|
885
|
+
# @yieldparam result [Google::Apis::ChatV1::ListMessagesResponse] parsed result object
|
886
|
+
# @yieldparam err [StandardError] error object if request failed
|
887
|
+
#
|
888
|
+
# @return [Google::Apis::ChatV1::ListMessagesResponse]
|
889
|
+
#
|
890
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
891
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
892
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
893
|
+
def 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, &block)
|
894
|
+
command = make_simple_command(:get, 'v1/{+parent}/messages', options)
|
895
|
+
command.response_representation = Google::Apis::ChatV1::ListMessagesResponse::Representation
|
896
|
+
command.response_class = Google::Apis::ChatV1::ListMessagesResponse
|
897
|
+
command.params['parent'] = parent unless parent.nil?
|
898
|
+
command.query['filter'] = filter unless filter.nil?
|
899
|
+
command.query['orderBy'] = order_by unless order_by.nil?
|
900
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
901
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
902
|
+
command.query['showDeleted'] = show_deleted unless show_deleted.nil?
|
903
|
+
command.query['fields'] = fields unless fields.nil?
|
904
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
905
|
+
execute_or_queue_command(command, &block)
|
906
|
+
end
|
907
|
+
|
908
|
+
# Updates a message. There's a difference between `patch` and `update` methods.
|
909
|
+
# The `patch` method uses a `patch` request while the `update` method uses a `
|
910
|
+
# put` request. We recommend using the `patch` method. For example usage, see [
|
911
|
+
# Update a message](https://developers.google.com/chat/api/guides/crudl/messages#
|
912
|
+
# update_a_message). Requires [authentication](https://developers.google.com/
|
913
|
+
# chat/api/guides/auth/). Fully supports [service account authentication](https:/
|
914
|
+
# /developers.google.com/chat/api/guides/auth/service-accounts). Supports [user
|
915
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) as
|
916
|
+
# part of the [Google Workspace Developer Preview Program](https://developers.
|
917
|
+
# google.com/workspace/preview), which grants early access to certain features. [
|
918
|
+
# User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
919
|
+
# requires the `chat.messages` authorization scope.
|
432
920
|
# @param [String] name
|
433
921
|
# Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/
|
434
922
|
# messages/BBBBBBBBBBB.BBBBBBBBBBB`
|
435
923
|
# @param [Google::Apis::ChatV1::Message] message_object
|
436
924
|
# @param [Boolean] allow_missing
|
437
|
-
# Optional. If `true` and the message
|
438
|
-
#
|
925
|
+
# Optional. If `true` and the message isn't found, a new message is created and `
|
926
|
+
# updateMask` is ignored. The specified message ID must be [client-assigned](
|
439
927
|
# https://developers.google.com/chat/api/guides/crudl/messages#
|
440
928
|
# name_a_created_message) or the request fails.
|
441
929
|
# @param [String] update_mask
|
442
930
|
# Required. The field paths to update. Separate multiple values with commas.
|
443
|
-
# Currently supported field paths: - text - cards (Requires [service account
|
444
|
-
# authentication](/chat/api/guides/auth/service-accounts).) - cards_v2
|
931
|
+
# Currently supported field paths: - `text` - `cards` (Requires [service account
|
932
|
+
# authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2`
|
445
933
|
# @param [String] fields
|
446
934
|
# Selector specifying which fields to include in a partial response.
|
447
935
|
# @param [String] quota_user
|
@@ -473,29 +961,31 @@ module Google
|
|
473
961
|
execute_or_queue_command(command, &block)
|
474
962
|
end
|
475
963
|
|
476
|
-
# Updates a message.
|
477
|
-
#
|
478
|
-
#
|
479
|
-
#
|
480
|
-
#
|
481
|
-
#
|
482
|
-
#
|
483
|
-
#
|
484
|
-
#
|
485
|
-
#
|
964
|
+
# Updates a message. There's a difference between `patch` and `update` methods.
|
965
|
+
# The `patch` method uses a `patch` request while the `update` method uses a `
|
966
|
+
# put` request. We recommend using the `patch` method. For example usage, see [
|
967
|
+
# Update a message](https://developers.google.com/chat/api/guides/crudl/messages#
|
968
|
+
# update_a_message). Requires [authentication](https://developers.google.com/
|
969
|
+
# chat/api/guides/auth/). Fully supports [service account authentication](https:/
|
970
|
+
# /developers.google.com/chat/api/guides/auth/service-accounts). Supports [user
|
971
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) as
|
972
|
+
# part of the [Google Workspace Developer Preview Program](https://developers.
|
973
|
+
# google.com/workspace/preview), which grants early access to certain features. [
|
974
|
+
# User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
975
|
+
# requires the `chat.messages` authorization scope.
|
486
976
|
# @param [String] name
|
487
977
|
# Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/
|
488
978
|
# messages/BBBBBBBBBBB.BBBBBBBBBBB`
|
489
979
|
# @param [Google::Apis::ChatV1::Message] message_object
|
490
980
|
# @param [Boolean] allow_missing
|
491
|
-
# Optional. If `true` and the message
|
492
|
-
#
|
981
|
+
# Optional. If `true` and the message isn't found, a new message is created and `
|
982
|
+
# updateMask` is ignored. The specified message ID must be [client-assigned](
|
493
983
|
# https://developers.google.com/chat/api/guides/crudl/messages#
|
494
984
|
# name_a_created_message) or the request fails.
|
495
985
|
# @param [String] update_mask
|
496
986
|
# Required. The field paths to update. Separate multiple values with commas.
|
497
|
-
# Currently supported field paths: - text - cards (Requires [service account
|
498
|
-
# authentication](/chat/api/guides/auth/service-accounts).) - cards_v2
|
987
|
+
# Currently supported field paths: - `text` - `cards` (Requires [service account
|
988
|
+
# authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2`
|
499
989
|
# @param [String] fields
|
500
990
|
# Selector specifying which fields to include in a partial response.
|
501
991
|
# @param [String] quota_user
|
@@ -532,8 +1022,8 @@ module Google
|
|
532
1022
|
# media/download). Requires [service account authentication](https://developers.
|
533
1023
|
# google.com/chat/api/guides/auth/service-accounts).
|
534
1024
|
# @param [String] name
|
535
|
-
# Required. Resource name of the attachment, in the form
|
536
|
-
# attachments
|
1025
|
+
# Required. Resource name of the attachment, in the form `spaces/*/messages/*/
|
1026
|
+
# attachments/*`.
|
537
1027
|
# @param [String] fields
|
538
1028
|
# Selector specifying which fields to include in a partial response.
|
539
1029
|
# @param [String] quota_user
|
@@ -560,6 +1050,146 @@ module Google
|
|
560
1050
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
561
1051
|
execute_or_queue_command(command, &block)
|
562
1052
|
end
|
1053
|
+
|
1054
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Creates
|
1055
|
+
# a reaction and adds it to a message. Requires [user authentication](https://
|
1056
|
+
# developers.google.com/chat/api/guides/auth/users) and the `chat.messages`, `
|
1057
|
+
# chat.messages.reactions`, or `chat.messages.reactions.create` scope. Only
|
1058
|
+
# unicode emoji are supported.
|
1059
|
+
# @param [String] parent
|
1060
|
+
# Required. The message where the reaction is created. Format: `spaces/`space`/
|
1061
|
+
# messages/`message``
|
1062
|
+
# @param [Google::Apis::ChatV1::Reaction] reaction_object
|
1063
|
+
# @param [String] fields
|
1064
|
+
# Selector specifying which fields to include in a partial response.
|
1065
|
+
# @param [String] quota_user
|
1066
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1067
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1068
|
+
# @param [Google::Apis::RequestOptions] options
|
1069
|
+
# Request-specific options
|
1070
|
+
#
|
1071
|
+
# @yield [result, err] Result & error if block supplied
|
1072
|
+
# @yieldparam result [Google::Apis::ChatV1::Reaction] parsed result object
|
1073
|
+
# @yieldparam err [StandardError] error object if request failed
|
1074
|
+
#
|
1075
|
+
# @return [Google::Apis::ChatV1::Reaction]
|
1076
|
+
#
|
1077
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1078
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1079
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1080
|
+
def create_space_message_reaction(parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
1081
|
+
command = make_simple_command(:post, 'v1/{+parent}/reactions', options)
|
1082
|
+
command.request_representation = Google::Apis::ChatV1::Reaction::Representation
|
1083
|
+
command.request_object = reaction_object
|
1084
|
+
command.response_representation = Google::Apis::ChatV1::Reaction::Representation
|
1085
|
+
command.response_class = Google::Apis::ChatV1::Reaction
|
1086
|
+
command.params['parent'] = parent unless parent.nil?
|
1087
|
+
command.query['fields'] = fields unless fields.nil?
|
1088
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1089
|
+
execute_or_queue_command(command, &block)
|
1090
|
+
end
|
1091
|
+
|
1092
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Deletes
|
1093
|
+
# a reaction to a message. Requires [user authentication](https://developers.
|
1094
|
+
# google.com/chat/api/guides/auth/users) and the `chat.messages` or `chat.
|
1095
|
+
# messages.reactions` scope.
|
1096
|
+
# @param [String] name
|
1097
|
+
# Required. Name of the reaction to delete. Format: `spaces/`space`/messages/`
|
1098
|
+
# message`/reactions/`reaction``
|
1099
|
+
# @param [String] fields
|
1100
|
+
# Selector specifying which fields to include in a partial response.
|
1101
|
+
# @param [String] quota_user
|
1102
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1103
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1104
|
+
# @param [Google::Apis::RequestOptions] options
|
1105
|
+
# Request-specific options
|
1106
|
+
#
|
1107
|
+
# @yield [result, err] Result & error if block supplied
|
1108
|
+
# @yieldparam result [Google::Apis::ChatV1::Empty] parsed result object
|
1109
|
+
# @yieldparam err [StandardError] error object if request failed
|
1110
|
+
#
|
1111
|
+
# @return [Google::Apis::ChatV1::Empty]
|
1112
|
+
#
|
1113
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1114
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1115
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1116
|
+
def delete_space_message_reaction(name, fields: nil, quota_user: nil, options: nil, &block)
|
1117
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
1118
|
+
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
1119
|
+
command.response_class = Google::Apis::ChatV1::Empty
|
1120
|
+
command.params['name'] = name unless name.nil?
|
1121
|
+
command.query['fields'] = fields unless fields.nil?
|
1122
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1123
|
+
execute_or_queue_command(command, &block)
|
1124
|
+
end
|
1125
|
+
|
1126
|
+
# [Developer Preview](https://developers.google.com/workspace/preview): Lists
|
1127
|
+
# reactions to a message. Requires [user authentication](https://developers.
|
1128
|
+
# google.com/chat/api/guides/auth/users) and `chat.messages`, `chat.messages.
|
1129
|
+
# readonly`, `chat.messages.reactions`, or `chat.messages.reactions.readonly`
|
1130
|
+
# scope.
|
1131
|
+
# @param [String] parent
|
1132
|
+
# Required. The message users reacted to. Format: `spaces/`space`/messages/`
|
1133
|
+
# message``
|
1134
|
+
# @param [String] filter
|
1135
|
+
# Optional. A query filter. You can filter reactions by [emoji](https://
|
1136
|
+
# developers.google.com/chat/api/reference/rest/v1/Emoji) (either `emoji.unicode`
|
1137
|
+
# or `emoji.custom_emoji.uid`) and [user](https://developers.google.com/chat/
|
1138
|
+
# api/reference/rest/v1/User) (`user.name`). To filter reactions for multiple
|
1139
|
+
# emojis or users, join similar fields with the `OR` operator, such as `emoji.
|
1140
|
+
# unicode = "🙂" OR emoji.unicode = "👍"` and `user.name = "users/AAAAAA" OR user.
|
1141
|
+
# name = "users/BBBBBB"`. To filter reactions by emoji and user, use the `AND`
|
1142
|
+
# operator, such as `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. If
|
1143
|
+
# your query uses both `AND` and `OR`, group them with parentheses. For example,
|
1144
|
+
# the following queries are valid: ``` user.name = "users/`user`" emoji.unicode =
|
1145
|
+
# "🙂" emoji.custom_emoji.uid = "`uid`" emoji.unicode = "🙂" OR emoji.unicode = "👍
|
1146
|
+
# " emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "`uid`" emoji.unicode = "🙂"
|
1147
|
+
# AND user.name = "users/`user`" (emoji.unicode = "🙂" OR emoji.custom_emoji.uid =
|
1148
|
+
# "`uid`") AND user.name = "users/`user`" ``` The following queries are invalid:
|
1149
|
+
# ``` emoji.unicode = "🙂" AND emoji.unicode = "👍" emoji.unicode = "🙂" AND emoji.
|
1150
|
+
# custom_emoji.uid = "`uid`" emoji.unicode = "🙂" OR user.name = "users/`user`"
|
1151
|
+
# emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "`uid`" OR user.name = "users/`
|
1152
|
+
# user`" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "`uid`" AND user.name =
|
1153
|
+
# "users/`user`" ``` Invalid queries are rejected by the server with an `
|
1154
|
+
# INVALID_ARGUMENT` error.
|
1155
|
+
# @param [Fixnum] page_size
|
1156
|
+
# Optional. The maximum number of reactions returned. The service can return
|
1157
|
+
# fewer reactions than this value. If unspecified, the default value is 25. The
|
1158
|
+
# maximum value is 200; values above 200 are changed to 200.
|
1159
|
+
# @param [String] page_token
|
1160
|
+
# Optional. (If resuming from a previous query.) A page token received from a
|
1161
|
+
# previous list reactions call. Provide this to retrieve the subsequent page.
|
1162
|
+
# When paginating, the filter value should match the call that provided the page
|
1163
|
+
# token. Passing a different value might lead to unexpected results.
|
1164
|
+
# @param [String] fields
|
1165
|
+
# Selector specifying which fields to include in a partial response.
|
1166
|
+
# @param [String] quota_user
|
1167
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1168
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1169
|
+
# @param [Google::Apis::RequestOptions] options
|
1170
|
+
# Request-specific options
|
1171
|
+
#
|
1172
|
+
# @yield [result, err] Result & error if block supplied
|
1173
|
+
# @yieldparam result [Google::Apis::ChatV1::ListReactionsResponse] parsed result object
|
1174
|
+
# @yieldparam err [StandardError] error object if request failed
|
1175
|
+
#
|
1176
|
+
# @return [Google::Apis::ChatV1::ListReactionsResponse]
|
1177
|
+
#
|
1178
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1179
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1180
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1181
|
+
def list_space_message_reactions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
1182
|
+
command = make_simple_command(:get, 'v1/{+parent}/reactions', options)
|
1183
|
+
command.response_representation = Google::Apis::ChatV1::ListReactionsResponse::Representation
|
1184
|
+
command.response_class = Google::Apis::ChatV1::ListReactionsResponse
|
1185
|
+
command.params['parent'] = parent unless parent.nil?
|
1186
|
+
command.query['filter'] = filter unless filter.nil?
|
1187
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
1188
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
1189
|
+
command.query['fields'] = fields unless fields.nil?
|
1190
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1191
|
+
execute_or_queue_command(command, &block)
|
1192
|
+
end
|
563
1193
|
|
564
1194
|
protected
|
565
1195
|
|