google-apis-chat_v1 0.58.0 → 0.60.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/google/apis/chat_v1/classes.rb +875 -309
- 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 +769 -128
- data/lib/google/apis/chat_v1.rb +18 -0
- metadata +3 -3
@@ -88,17 +88,189 @@ module Google
|
|
88
88
|
execute_or_queue_command(command, &block)
|
89
89
|
end
|
90
90
|
|
91
|
-
#
|
92
|
-
# api/guides/
|
93
|
-
# developers.google.com/chat/api/guides/
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
91
|
+
# Uploads an attachment. For an example, see [Upload media as a file attachment](
|
92
|
+
# https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload).
|
93
|
+
# Requires user [authentication](https://developers.google.com/chat/api/guides/
|
94
|
+
# auth/users) and the `chat.messages` or `chat.messages.create` authorization
|
95
|
+
# scope. You can upload attachments up to 200 MB. Certain file types aren't
|
96
|
+
# supported. For details, see [File types blocked by Google Chat](https://
|
97
|
+
# support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%
|
98
|
+
# 20types%20blocked%20in%20Google%20Chat).
|
99
|
+
# @param [String] parent
|
100
|
+
# Required. Resource name of the Chat space in which the attachment is uploaded.
|
101
|
+
# Format "spaces/`space`".
|
102
|
+
# @param [Google::Apis::ChatV1::UploadAttachmentRequest] upload_attachment_request_object
|
103
|
+
# @param [String] fields
|
104
|
+
# Selector specifying which fields to include in a partial response.
|
105
|
+
# @param [String] quota_user
|
106
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
107
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
108
|
+
# @param [IO, String] upload_source
|
109
|
+
# IO stream or filename containing content to upload
|
110
|
+
# @param [String] content_type
|
111
|
+
# Content type of the uploaded content.
|
112
|
+
# @param [Google::Apis::RequestOptions] options
|
113
|
+
# Request-specific options
|
114
|
+
#
|
115
|
+
# @yield [result, err] Result & error if block supplied
|
116
|
+
# @yieldparam result [Google::Apis::ChatV1::UploadAttachmentResponse] parsed result object
|
117
|
+
# @yieldparam err [StandardError] error object if request failed
|
118
|
+
#
|
119
|
+
# @return [Google::Apis::ChatV1::UploadAttachmentResponse]
|
120
|
+
#
|
121
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
122
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
123
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
124
|
+
def upload_medium_attachment(parent, upload_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
|
125
|
+
if upload_source.nil?
|
126
|
+
command = make_simple_command(:post, 'v1/{+parent}/attachments:upload', options)
|
127
|
+
else
|
128
|
+
command = make_upload_command(:post, 'v1/{+parent}/attachments:upload', options)
|
129
|
+
command.upload_source = upload_source
|
130
|
+
command.upload_content_type = content_type
|
131
|
+
end
|
132
|
+
command.request_representation = Google::Apis::ChatV1::UploadAttachmentRequest::Representation
|
133
|
+
command.request_object = upload_attachment_request_object
|
134
|
+
command.response_representation = Google::Apis::ChatV1::UploadAttachmentResponse::Representation
|
135
|
+
command.response_class = Google::Apis::ChatV1::UploadAttachmentResponse
|
136
|
+
command.params['parent'] = parent unless parent.nil?
|
137
|
+
command.query['fields'] = fields unless fields.nil?
|
138
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
139
|
+
execute_or_queue_command(command, &block)
|
140
|
+
end
|
141
|
+
|
142
|
+
# Creates a named space. Spaces grouped by topics or that have guest access aren'
|
143
|
+
# t supported. For an example, see [Create a space](https://developers.google.
|
144
|
+
# com/chat/api/guides/v1/spaces/create). Requires [user authentication](https://
|
145
|
+
# developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create`
|
146
|
+
# or `chat.spaces` scope.
|
147
|
+
# @param [Google::Apis::ChatV1::Space] space_object
|
148
|
+
# @param [String] request_id
|
149
|
+
# Optional. A unique identifier for this request. A random UUID is recommended.
|
150
|
+
# Specifying an existing request ID returns the space created with that ID
|
151
|
+
# instead of creating a new space. Specifying an existing request ID from the
|
152
|
+
# same Chat app with a different authenticated user returns an error.
|
153
|
+
# @param [String] fields
|
154
|
+
# Selector specifying which fields to include in a partial response.
|
155
|
+
# @param [String] quota_user
|
156
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
157
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
158
|
+
# @param [Google::Apis::RequestOptions] options
|
159
|
+
# Request-specific options
|
160
|
+
#
|
161
|
+
# @yield [result, err] Result & error if block supplied
|
162
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
163
|
+
# @yieldparam err [StandardError] error object if request failed
|
164
|
+
#
|
165
|
+
# @return [Google::Apis::ChatV1::Space]
|
166
|
+
#
|
167
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
168
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
169
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
170
|
+
def create_space(space_object = nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
|
171
|
+
command = make_simple_command(:post, 'v1/spaces', options)
|
172
|
+
command.request_representation = Google::Apis::ChatV1::Space::Representation
|
173
|
+
command.request_object = space_object
|
174
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
175
|
+
command.response_class = Google::Apis::ChatV1::Space
|
176
|
+
command.query['requestId'] = request_id unless request_id.nil?
|
177
|
+
command.query['fields'] = fields unless fields.nil?
|
178
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
179
|
+
execute_or_queue_command(command, &block)
|
180
|
+
end
|
181
|
+
|
182
|
+
# Deletes a named space. Always performs a cascading delete, which means that
|
183
|
+
# the space's child resources—like messages posted in the space and memberships
|
184
|
+
# in the space—are also deleted. For an example, see [Delete a space](https://
|
185
|
+
# developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user
|
186
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) from
|
187
|
+
# a user who has permission to delete the space, and the `chat.delete` scope.
|
188
|
+
# @param [String] name
|
189
|
+
# Required. Resource name of the space to delete. Format: `spaces/`space``
|
190
|
+
# @param [String] fields
|
191
|
+
# Selector specifying which fields to include in a partial response.
|
192
|
+
# @param [String] quota_user
|
193
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
194
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
195
|
+
# @param [Google::Apis::RequestOptions] options
|
196
|
+
# Request-specific options
|
197
|
+
#
|
198
|
+
# @yield [result, err] Result & error if block supplied
|
199
|
+
# @yieldparam result [Google::Apis::ChatV1::Empty] parsed result object
|
200
|
+
# @yieldparam err [StandardError] error object if request failed
|
201
|
+
#
|
202
|
+
# @return [Google::Apis::ChatV1::Empty]
|
203
|
+
#
|
204
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
205
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
206
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
207
|
+
def delete_space(name, fields: nil, quota_user: nil, options: nil, &block)
|
208
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
209
|
+
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
210
|
+
command.response_class = Google::Apis::ChatV1::Empty
|
211
|
+
command.params['name'] = name unless name.nil?
|
212
|
+
command.query['fields'] = fields unless fields.nil?
|
213
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
214
|
+
execute_or_queue_command(command, &block)
|
215
|
+
end
|
216
|
+
|
217
|
+
# Returns the existing direct message with the specified user. If no direct
|
218
|
+
# message space is found, returns a `404 NOT_FOUND` error. For an example, see [
|
219
|
+
# Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [
|
220
|
+
# user authentication](https://developers.google.com/chat/api/guides/auth/users),
|
221
|
+
# returns the direct message space between the specified user and the
|
222
|
+
# authenticated user. With [service account authentication](https://developers.
|
223
|
+
# google.com/chat/api/guides/auth/service-accounts), returns the direct message
|
224
|
+
# space between the specified user and the calling Chat app. Requires [user
|
225
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) or [
|
226
|
+
# service account authentication](https://developers.google.com/chat/api/guides/
|
227
|
+
# auth/service-accounts).
|
228
|
+
# @param [String] name
|
229
|
+
# Required. Resource name of the user to find direct message with. Format: `
|
230
|
+
# users/`user``, where ``user`` is either the ``person_id`` for the [person](
|
231
|
+
# https://developers.google.com/people/api/rest/v1/people) from the People API,
|
232
|
+
# or the `id` for the [user](https://developers.google.com/admin-sdk/directory/
|
233
|
+
# reference/rest/v1/users) in the Directory API. For example, if the People API `
|
234
|
+
# Person.resourceName` is `people/123456789`, you can find a direct message with
|
235
|
+
# that person by using `users/123456789` as the `name`.
|
236
|
+
# @param [String] fields
|
237
|
+
# Selector specifying which fields to include in a partial response.
|
238
|
+
# @param [String] quota_user
|
239
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
240
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
241
|
+
# @param [Google::Apis::RequestOptions] options
|
242
|
+
# Request-specific options
|
243
|
+
#
|
244
|
+
# @yield [result, err] Result & error if block supplied
|
245
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
246
|
+
# @yieldparam err [StandardError] error object if request failed
|
247
|
+
#
|
248
|
+
# @return [Google::Apis::ChatV1::Space]
|
249
|
+
#
|
250
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
251
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
252
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
253
|
+
def find_space_direct_message(name: nil, fields: nil, quota_user: nil, options: nil, &block)
|
254
|
+
command = make_simple_command(:get, 'v1/spaces:findDirectMessage', options)
|
255
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
256
|
+
command.response_class = Google::Apis::ChatV1::Space
|
257
|
+
command.query['name'] = name unless name.nil?
|
258
|
+
command.query['fields'] = fields unless fields.nil?
|
259
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
260
|
+
execute_or_queue_command(command, &block)
|
261
|
+
end
|
262
|
+
|
263
|
+
# Returns details about a space. For an example, see [Get a space](https://
|
264
|
+
# developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication]
|
265
|
+
# (https://developers.google.com/chat/api/guides/auth). Fully supports [service
|
266
|
+
# account authentication](https://developers.google.com/chat/api/guides/auth/
|
267
|
+
# service-accounts) and [user authentication](https://developers.google.com/chat/
|
268
|
+
# api/guides/auth/users). [User authentication](https://developers.google.com/
|
269
|
+
# chat/api/guides/auth/users) requires the `chat.spaces` or `chat.spaces.
|
270
|
+
# readonly` authorization scope.
|
99
271
|
# @param [String] name
|
100
|
-
# Required. Resource name of the space, in the form "spaces/*". Format: spaces/`
|
101
|
-
# space
|
272
|
+
# Required. Resource name of the space, in the form "spaces/*". Format: `spaces/`
|
273
|
+
# space``
|
102
274
|
# @param [String] fields
|
103
275
|
# Selector specifying which fields to include in a partial response.
|
104
276
|
# @param [String] quota_user
|
@@ -126,27 +298,40 @@ module Google
|
|
126
298
|
execute_or_queue_command(command, &block)
|
127
299
|
end
|
128
300
|
|
129
|
-
# Lists spaces the caller is a member of.
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
# readonly` authorization scope. Lists spaces visible to the caller or
|
301
|
+
# Lists spaces the caller is a member of. Group chats and DMs aren't listed
|
302
|
+
# until the first message is sent. For an example, see [List spaces](https://
|
303
|
+
# developers.google.com/chat/api/guides/v1/spaces/list). Requires [
|
304
|
+
# authentication](https://developers.google.com/chat/api/guides/auth). Fully
|
305
|
+
# supports [service account authentication](https://developers.google.com/chat/
|
306
|
+
# api/guides/auth/service-accounts) and [user authentication](https://developers.
|
307
|
+
# google.com/chat/api/guides/auth/users) requires the `chat.spaces` or `chat.
|
308
|
+
# spaces.readonly` authorization scope. Lists spaces visible to the caller or
|
138
309
|
# authenticated user. Group chats and DMs aren't listed until the first message
|
139
310
|
# is sent.
|
311
|
+
# @param [String] filter
|
312
|
+
# Optional. A query filter. Requires [user authentication](https://developers.
|
313
|
+
# google.com/chat/api/guides/auth/users). You can filter spaces by the space
|
314
|
+
# type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/
|
315
|
+
# spaces#spacetype)). To filter by space type, you must specify valid enum value,
|
316
|
+
# such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `
|
317
|
+
# SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
|
318
|
+
# operator. For example, the following queries are valid: ``` space_type = "
|
319
|
+
# SPACE" spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" ``` Invalid
|
320
|
+
# queries are rejected by the server with an `INVALID_ARGUMENT` error. With [
|
321
|
+
# service account authentication](https://developers.google.com/chat/api/guides/
|
322
|
+
# auth/service-accounts), this field is ignored and the query always returns all
|
323
|
+
# spaces. But the Chat API still validates the query syntax with service
|
324
|
+
# accounts, so invalid queries are still rejected.
|
140
325
|
# @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.
|
326
|
+
# Optional. The maximum number of spaces to return. The service might return
|
327
|
+
# fewer than this value. If unspecified, at most 100 spaces are returned. The
|
328
|
+
# maximum value is 1,000. If you use a value more than 1,000, it's automatically
|
329
|
+
# changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
145
330
|
# @param [String] page_token
|
146
331
|
# 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.
|
332
|
+
# this parameter to retrieve the subsequent page. When paginating, the filter
|
333
|
+
# value should match the call that provided the page token. Passing a different
|
334
|
+
# value may lead to unexpected results.
|
150
335
|
# @param [String] fields
|
151
336
|
# Selector specifying which fields to include in a partial response.
|
152
337
|
# @param [String] quota_user
|
@@ -164,10 +349,11 @@ module Google
|
|
164
349
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
165
350
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
166
351
|
# @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)
|
352
|
+
def list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
168
353
|
command = make_simple_command(:get, 'v1/spaces', options)
|
169
354
|
command.response_representation = Google::Apis::ChatV1::ListSpacesResponse::Representation
|
170
355
|
command.response_class = Google::Apis::ChatV1::ListSpacesResponse
|
356
|
+
command.query['filter'] = filter unless filter.nil?
|
171
357
|
command.query['pageSize'] = page_size unless page_size.nil?
|
172
358
|
command.query['pageToken'] = page_token unless page_token.nil?
|
173
359
|
command.query['fields'] = fields unless fields.nil?
|
@@ -175,18 +361,218 @@ module Google
|
|
175
361
|
execute_or_queue_command(command, &block)
|
176
362
|
end
|
177
363
|
|
178
|
-
#
|
179
|
-
# chat/api/guides/
|
180
|
-
#
|
181
|
-
# authentication](https://developers.google.com/chat/api/guides/auth/users) as
|
182
|
-
# part of the [Google Workspace Developer Preview Program](https://developers.
|
183
|
-
# google.com/workspace/preview), which grants early access to certain features. [
|
184
|
-
# User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
185
|
-
# requires the `chat.memberships` or `chat.memberships.readonly` authorization
|
364
|
+
# Updates a space. For an example, see [Update a space](https://developers.
|
365
|
+
# google.com/chat/api/guides/v1/spaces/update). Requires [user authentication](
|
366
|
+
# https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces`
|
186
367
|
# scope.
|
187
368
|
# @param [String] name
|
188
|
-
#
|
189
|
-
#
|
369
|
+
# Resource name of the space. Format: `spaces/`space``
|
370
|
+
# @param [Google::Apis::ChatV1::Space] space_object
|
371
|
+
# @param [String] update_mask
|
372
|
+
# Required. The updated field paths, comma separated if there are multiple.
|
373
|
+
# Currently supported field paths: - `display_name` (Only supports changing the
|
374
|
+
# display name of a space with the `SPACE` type, or when also including the `
|
375
|
+
# space_type` mask to change a `GROUP_CHAT` space type to `SPACE`. Trying to
|
376
|
+
# update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space results
|
377
|
+
# in an invalid argument error.) - `space_type` (Only supports changing a `
|
378
|
+
# GROUP_CHAT` space type to `SPACE`. Include `display_name` together with `
|
379
|
+
# space_type` in the update mask and ensure that the specified space has a non-
|
380
|
+
# empty display name and the `SPACE` space type. Including the `space_type` mask
|
381
|
+
# and the `SPACE` type in the specified space when updating the display name is
|
382
|
+
# optional if the existing space already has the `SPACE` type. Trying to update
|
383
|
+
# the space type in other ways results in an invalid argument error). - `
|
384
|
+
# space_details` - `space_history_state` (Supports [turning history on or off
|
385
|
+
# for the space](https://support.google.com/chat/answer/7664687) if [the
|
386
|
+
# organization allows users to change their history setting](https://support.
|
387
|
+
# google.com/a/answer/7664184). Warning: mutually exclusive with all other field
|
388
|
+
# paths.)
|
389
|
+
# @param [String] fields
|
390
|
+
# Selector specifying which fields to include in a partial response.
|
391
|
+
# @param [String] quota_user
|
392
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
393
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
394
|
+
# @param [Google::Apis::RequestOptions] options
|
395
|
+
# Request-specific options
|
396
|
+
#
|
397
|
+
# @yield [result, err] Result & error if block supplied
|
398
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
399
|
+
# @yieldparam err [StandardError] error object if request failed
|
400
|
+
#
|
401
|
+
# @return [Google::Apis::ChatV1::Space]
|
402
|
+
#
|
403
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
404
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
405
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
406
|
+
def patch_space(name, space_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
407
|
+
command = make_simple_command(:patch, 'v1/{+name}', options)
|
408
|
+
command.request_representation = Google::Apis::ChatV1::Space::Representation
|
409
|
+
command.request_object = space_object
|
410
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
411
|
+
command.response_class = Google::Apis::ChatV1::Space
|
412
|
+
command.params['name'] = name unless name.nil?
|
413
|
+
command.query['updateMask'] = update_mask unless update_mask.nil?
|
414
|
+
command.query['fields'] = fields unless fields.nil?
|
415
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
416
|
+
execute_or_queue_command(command, &block)
|
417
|
+
end
|
418
|
+
|
419
|
+
# Creates a space and adds specified users to it. The calling user is
|
420
|
+
# automatically added to the space, and shouldn't be specified as a membership
|
421
|
+
# in the request. For an example, see [Set up a space](https://developers.google.
|
422
|
+
# com/chat/api/guides/v1/spaces/set-up). To specify the human members to add,
|
423
|
+
# add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`.
|
424
|
+
# To add a human user, use `users/`user``, where ``user`` is either the ``
|
425
|
+
# person_id`` for the [person](https://developers.google.com/people/api/rest/v1/
|
426
|
+
# people) from the People API, or the `id` for the [user](https://developers.
|
427
|
+
# google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK
|
428
|
+
# Directory API. For example, if the People API `Person` `resourceName` is `
|
429
|
+
# people/123456789`, you can add the user to the space by including a membership
|
430
|
+
# with `users/123456789` as the `member.name`. For a space or group chat, if the
|
431
|
+
# caller blocks or is blocked by some members, then those members aren't added
|
432
|
+
# to the created space. To create a direct message (DM) between the calling user
|
433
|
+
# and another human user, specify exactly one membership to represent the human
|
434
|
+
# user. If one user blocks the other, the request fails and the DM isn't created.
|
435
|
+
# To create a DM between the calling user and the calling app, set `Space.
|
436
|
+
# singleUserBotDm` to `true` and don't specify any memberships. You can only use
|
437
|
+
# this method to set up a DM with the calling app. To add the calling app as a
|
438
|
+
# member of a space or an existing DM between two human users, see [create a
|
439
|
+
# membership](https://developers.google.com/chat/api/guides/v1/members/create).
|
440
|
+
# If a DM already exists between two users, even when one user blocks the other
|
441
|
+
# at the time a request is made, then the existing DM is returned. Spaces with
|
442
|
+
# threaded replies or guest access aren't supported. Requires [user
|
443
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) and
|
444
|
+
# the `chat.spaces.create` or `chat.spaces` scope.
|
445
|
+
# @param [Google::Apis::ChatV1::SetUpSpaceRequest] set_up_space_request_object
|
446
|
+
# @param [String] fields
|
447
|
+
# Selector specifying which fields to include in a partial response.
|
448
|
+
# @param [String] quota_user
|
449
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
450
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
451
|
+
# @param [Google::Apis::RequestOptions] options
|
452
|
+
# Request-specific options
|
453
|
+
#
|
454
|
+
# @yield [result, err] Result & error if block supplied
|
455
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
456
|
+
# @yieldparam err [StandardError] error object if request failed
|
457
|
+
#
|
458
|
+
# @return [Google::Apis::ChatV1::Space]
|
459
|
+
#
|
460
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
461
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
462
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
463
|
+
def setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
464
|
+
command = make_simple_command(:post, 'v1/spaces:setup', options)
|
465
|
+
command.request_representation = Google::Apis::ChatV1::SetUpSpaceRequest::Representation
|
466
|
+
command.request_object = set_up_space_request_object
|
467
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
468
|
+
command.response_class = Google::Apis::ChatV1::Space
|
469
|
+
command.query['fields'] = fields unless fields.nil?
|
470
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
471
|
+
execute_or_queue_command(command, &block)
|
472
|
+
end
|
473
|
+
|
474
|
+
# Creates a human membership or app membership for the calling app. Creating
|
475
|
+
# memberships for other apps isn't supported. For an example, see [ Create a
|
476
|
+
# membership](https://developers.google.com/chat/api/guides/v1/members/create).
|
477
|
+
# When creating a membership, if the specified member has their auto-accept
|
478
|
+
# policy turned off, then they're invited, and must accept the space invitation
|
479
|
+
# before joining. Otherwise, creating a membership adds the member directly to
|
480
|
+
# the specified space. Requires [user authentication](https://developers.google.
|
481
|
+
# com/chat/api/guides/auth/users) and the `chat.memberships` (for human
|
482
|
+
# membership) or `chat.memberships.app` (for app membership) scope. To specify
|
483
|
+
# the member to add, set the `membership.member.name` in the `
|
484
|
+
# CreateMembershipRequest`: - To add the calling app to a space or a direct
|
485
|
+
# message between two human users, use `users/app`. Unable to add other apps to
|
486
|
+
# the space. - To add a human user, use `users/`user``, where ``user`` is either
|
487
|
+
# the ``person_id`` for the [person](https://developers.google.com/people/api/
|
488
|
+
# rest/v1/people) from the People API, or the `id` for the [user](https://
|
489
|
+
# developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the
|
490
|
+
# Directory API. For example, if the People API `Person` `resourceName` is `
|
491
|
+
# people/123456789`, you can add the user to the space by setting the `
|
492
|
+
# membership.member.name` to `users/123456789`.
|
493
|
+
# @param [String] parent
|
494
|
+
# Required. The resource name of the space for which to create the membership.
|
495
|
+
# Format: spaces/`space`
|
496
|
+
# @param [Google::Apis::ChatV1::Membership] membership_object
|
497
|
+
# @param [String] fields
|
498
|
+
# Selector specifying which fields to include in a partial response.
|
499
|
+
# @param [String] quota_user
|
500
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
501
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
502
|
+
# @param [Google::Apis::RequestOptions] options
|
503
|
+
# Request-specific options
|
504
|
+
#
|
505
|
+
# @yield [result, err] Result & error if block supplied
|
506
|
+
# @yieldparam result [Google::Apis::ChatV1::Membership] parsed result object
|
507
|
+
# @yieldparam err [StandardError] error object if request failed
|
508
|
+
#
|
509
|
+
# @return [Google::Apis::ChatV1::Membership]
|
510
|
+
#
|
511
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
512
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
513
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
514
|
+
def create_space_member(parent, membership_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
515
|
+
command = make_simple_command(:post, 'v1/{+parent}/members', options)
|
516
|
+
command.request_representation = Google::Apis::ChatV1::Membership::Representation
|
517
|
+
command.request_object = membership_object
|
518
|
+
command.response_representation = Google::Apis::ChatV1::Membership::Representation
|
519
|
+
command.response_class = Google::Apis::ChatV1::Membership
|
520
|
+
command.params['parent'] = parent unless parent.nil?
|
521
|
+
command.query['fields'] = fields unless fields.nil?
|
522
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
523
|
+
execute_or_queue_command(command, &block)
|
524
|
+
end
|
525
|
+
|
526
|
+
# Deletes a membership. For an example, see [Delete a membership](https://
|
527
|
+
# developers.google.com/chat/api/guides/v1/members/delete). Requires [user
|
528
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) and
|
529
|
+
# the `chat.memberships` or `chat.memberships.app` authorization scope.
|
530
|
+
# @param [String] name
|
531
|
+
# Required. Resource name of the membership to delete. Chat apps can delete
|
532
|
+
# human users' or their own memberships. Chat apps can't delete other apps'
|
533
|
+
# memberships. When deleting a human membership, requires the `chat.memberships`
|
534
|
+
# scope and `spaces/`space`/members/`member`` format. When deleting an app
|
535
|
+
# membership, requires the `chat.memberships.app` scope and `spaces/`space`/
|
536
|
+
# members/app` format. Format: `spaces/`space`/members/`member`` or `spaces/`
|
537
|
+
# space`/members/app`
|
538
|
+
# @param [String] fields
|
539
|
+
# Selector specifying which fields to include in a partial response.
|
540
|
+
# @param [String] quota_user
|
541
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
542
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
543
|
+
# @param [Google::Apis::RequestOptions] options
|
544
|
+
# Request-specific options
|
545
|
+
#
|
546
|
+
# @yield [result, err] Result & error if block supplied
|
547
|
+
# @yieldparam result [Google::Apis::ChatV1::Membership] parsed result object
|
548
|
+
# @yieldparam err [StandardError] error object if request failed
|
549
|
+
#
|
550
|
+
# @return [Google::Apis::ChatV1::Membership]
|
551
|
+
#
|
552
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
553
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
554
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
555
|
+
def delete_space_member(name, fields: nil, quota_user: nil, options: nil, &block)
|
556
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
557
|
+
command.response_representation = Google::Apis::ChatV1::Membership::Representation
|
558
|
+
command.response_class = Google::Apis::ChatV1::Membership
|
559
|
+
command.params['name'] = name unless name.nil?
|
560
|
+
command.query['fields'] = fields unless fields.nil?
|
561
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
562
|
+
execute_or_queue_command(command, &block)
|
563
|
+
end
|
564
|
+
|
565
|
+
# Returns details about a membership. For an example, see [Get a membership](
|
566
|
+
# https://developers.google.com/chat/api/guides/v1/members/get). Requires [
|
567
|
+
# authentication](https://developers.google.com/chat/api/guides/auth). Fully
|
568
|
+
# supports [service account authentication](https://developers.google.com/chat/
|
569
|
+
# api/guides/auth/service-accounts) and [user authentication](https://developers.
|
570
|
+
# google.com/chat/api/guides/auth/users). [User authentication](https://
|
571
|
+
# developers.google.com/chat/api/guides/auth/users) requires the `chat.
|
572
|
+
# memberships` or `chat.memberships.readonly` authorization scope.
|
573
|
+
# @param [String] name
|
574
|
+
# Required. Resource name of the membership to retrieve. Format: `spaces/`space`/
|
575
|
+
# members/`member``
|
190
576
|
# @param [String] fields
|
191
577
|
# Selector specifying which fields to include in a partial response.
|
192
578
|
# @param [String] quota_user
|
@@ -214,28 +600,52 @@ module Google
|
|
214
600
|
execute_or_queue_command(command, &block)
|
215
601
|
end
|
216
602
|
|
217
|
-
# Lists memberships in a space.
|
218
|
-
# google.com/chat/api/guides/
|
219
|
-
# authentication](https://developers.google.com/chat/api/guides/auth/
|
220
|
-
# accounts)
|
221
|
-
#
|
222
|
-
#
|
223
|
-
#
|
224
|
-
# com/chat/api/guides/auth
|
225
|
-
#
|
603
|
+
# Lists memberships in a space. For an example, see [List memberships](https://
|
604
|
+
# developers.google.com/chat/api/guides/v1/members/list). Listing memberships
|
605
|
+
# with [app authentication](https://developers.google.com/chat/api/guides/auth/
|
606
|
+
# service-accounts) lists memberships in spaces that the Chat app has access to,
|
607
|
+
# but excludes Chat app memberships, including its own. Listing memberships with
|
608
|
+
# [User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
609
|
+
# lists memberships in spaces that the authenticated user has access to.
|
610
|
+
# Requires [authentication](https://developers.google.com/chat/api/guides/auth).
|
611
|
+
# Fully supports [service account authentication](https://developers.google.com/
|
612
|
+
# chat/api/guides/auth/service-accounts) and [user authentication](https://
|
613
|
+
# developers.google.com/chat/api/guides/auth/users). [User authentication](https:
|
614
|
+
# //developers.google.com/chat/api/guides/auth/users) requires the `chat.
|
615
|
+
# memberships` or `chat.memberships.readonly` authorization scope.
|
226
616
|
# @param [String] parent
|
227
617
|
# Required. The resource name of the space for which to fetch a membership list.
|
228
618
|
# Format: spaces/`space`
|
619
|
+
# @param [String] filter
|
620
|
+
# Optional. A query filter. You can filter memberships by a member's role ([`
|
621
|
+
# role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#
|
622
|
+
# membershiprole)) and type ([`member.type`](https://developers.google.com/chat/
|
623
|
+
# api/reference/rest/v1/User#type)). To filter by role, set `role` to `
|
624
|
+
# ROLE_MEMBER` or `ROLE_MANAGER`. To filter by type, set `member.type` to `HUMAN`
|
625
|
+
# or `BOT`. To filter by both role and type, use the `AND` operator. To filter
|
626
|
+
# by either role or type, use the `OR` operator. For example, the following
|
627
|
+
# queries are valid: ``` role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" member.
|
628
|
+
# type = "HUMAN" AND role = "ROLE_MANAGER" ``` The following queries are invalid:
|
629
|
+
# ``` member.type = "HUMAN" AND member.type = "BOT" role = "ROLE_MANAGER" AND
|
630
|
+
# role = "ROLE_MEMBER" ``` Invalid queries are rejected by the server with an `
|
631
|
+
# INVALID_ARGUMENT` error.
|
229
632
|
# @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.
|
633
|
+
# The maximum number of memberships to return. The service might return fewer
|
634
|
+
# than this value. If unspecified, at most 100 memberships are returned. The
|
635
|
+
# maximum value is 1,000. If you use a value more than 1,000, it's automatically
|
636
|
+
# changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
234
637
|
# @param [String] page_token
|
235
638
|
# 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
|
639
|
+
# parameter to retrieve the subsequent page. When paginating, all other
|
640
|
+
# parameters provided should match the call that provided the page token.
|
641
|
+
# Passing different values to the other parameters might lead to unexpected
|
642
|
+
# results.
|
643
|
+
# @param [Boolean] show_invited
|
644
|
+
# Optional. When `true`, also returns memberships associated with invited
|
645
|
+
# members, in addition to other types of memberships. If a filter is set,
|
646
|
+
# invited memberships that don't match the filter criteria aren't returned.
|
647
|
+
# Currently requires [user authentication](https://developers.google.com/chat/
|
648
|
+
# api/guides/auth/users).
|
239
649
|
# @param [String] fields
|
240
650
|
# Selector specifying which fields to include in a partial response.
|
241
651
|
# @param [String] quota_user
|
@@ -253,42 +663,50 @@ module Google
|
|
253
663
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
254
664
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
255
665
|
# @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)
|
666
|
+
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
667
|
command = make_simple_command(:get, 'v1/{+parent}/members', options)
|
258
668
|
command.response_representation = Google::Apis::ChatV1::ListMembershipsResponse::Representation
|
259
669
|
command.response_class = Google::Apis::ChatV1::ListMembershipsResponse
|
260
670
|
command.params['parent'] = parent unless parent.nil?
|
671
|
+
command.query['filter'] = filter unless filter.nil?
|
261
672
|
command.query['pageSize'] = page_size unless page_size.nil?
|
262
673
|
command.query['pageToken'] = page_token unless page_token.nil?
|
674
|
+
command.query['showInvited'] = show_invited unless show_invited.nil?
|
263
675
|
command.query['fields'] = fields unless fields.nil?
|
264
676
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
265
677
|
execute_or_queue_command(command, &block)
|
266
678
|
end
|
267
679
|
|
268
|
-
# Creates a message. For example
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
# chat/api/guides/auth/
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
# https://developers.google.com/chat/api/
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
680
|
+
# Creates a message. For an example, see [Create a message](https://developers.
|
681
|
+
# google.com/chat/api/guides/crudl/messages#create_a_message). Requires [
|
682
|
+
# authentication](https://developers.google.com/chat/api/guides/auth). Creating
|
683
|
+
# a text message supports both [user authentication](https://developers.google.
|
684
|
+
# com/chat/api/guides/auth/users) and [app authentication] (https://developers.
|
685
|
+
# google.com/chat/api/guides/auth/service-accounts). [User authentication](https:
|
686
|
+
# //developers.google.com/chat/api/guides/auth/users) requires the `chat.
|
687
|
+
# messages` or `chat.messages.create` authorization scope. Creating a card
|
688
|
+
# message requires [app authentication] (https://developers.google.com/chat/api/
|
689
|
+
# guides/auth/service-accounts) Because Chat provides authentication for [
|
690
|
+
# webhooks](https://developers.google.com/chat/how-tos/webhooks) as part of the
|
691
|
+
# URL that's generated when a webhook is registered, webhooks can create
|
692
|
+
# messages without a service account or user authentication.
|
281
693
|
# @param [String] parent
|
282
694
|
# Required. The resource name of the space in which to create a message. Format:
|
283
|
-
# spaces/`space
|
695
|
+
# `spaces/`space``
|
284
696
|
# @param [Google::Apis::ChatV1::Message] message_object
|
285
697
|
# @param [String] message_id
|
286
698
|
# Optional. A custom name for a Chat message assigned at creation. Must start
|
287
699
|
# with `client-` and contain only lowercase letters, numbers, and hyphens up to
|
288
700
|
# 63 characters in length. Specify this field to get, update, or delete the
|
289
|
-
# message with the specified value.
|
290
|
-
# message](
|
291
|
-
#
|
701
|
+
# message with the specified value. Assigning a custom name lets a a Chat app
|
702
|
+
# recall the message without saving the message `name` from the [response body](/
|
703
|
+
# chat/api/reference/rest/v1/spaces.messages/get#response-body) returned when
|
704
|
+
# creating the message. Assigning a custom name doesn't replace the generated `
|
705
|
+
# name` field, the message's resource name. Instead, it sets the custom name as
|
706
|
+
# the `clientAssignedMessageId` field, which you can reference while processing
|
707
|
+
# later operations, like updating or deleting the message. For example usage,
|
708
|
+
# see [Name a created message](https://developers.google.com/chat/api/guides/
|
709
|
+
# crudl/messages#name_a_created_message).
|
292
710
|
# @param [String] message_reply_option
|
293
711
|
# Optional. Specifies whether a message starts a thread or replies to one. Only
|
294
712
|
# supported in named spaces.
|
@@ -334,19 +752,23 @@ module Google
|
|
334
752
|
execute_or_queue_command(command, &block)
|
335
753
|
end
|
336
754
|
|
337
|
-
# Deletes a message. For example
|
338
|
-
#
|
339
|
-
#
|
340
|
-
#
|
341
|
-
#
|
342
|
-
#
|
343
|
-
#
|
344
|
-
# preview), which grants early access to certain features. [User authentication](
|
345
|
-
# https://developers.google.com/chat/api/guides/auth/users) requires the `chat.
|
346
|
-
# messages` authorization scope.
|
755
|
+
# Deletes a message. For an example, see [Delete a message](https://developers.
|
756
|
+
# google.com/chat/api/guides/v1/messages/delete). Requires [authentication](
|
757
|
+
# https://developers.google.com/chat/api/guides/auth). Fully supports [service
|
758
|
+
# account authentication](https://developers.google.com/chat/api/guides/auth/
|
759
|
+
# service-accounts) and [user authentication](https://developers.google.com/chat/
|
760
|
+
# api/guides/auth/users). [User authentication](https://developers.google.com/
|
761
|
+
# chat/api/guides/auth/users) requires the `chat.messages` authorization scope.
|
347
762
|
# @param [String] name
|
348
|
-
# Required. Resource name of the message to
|
349
|
-
# messages
|
763
|
+
# Required. Resource name of the message that you want to delete, in the form `
|
764
|
+
# spaces/*/messages/*` Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.
|
765
|
+
# BBBBBBBBBBB`
|
766
|
+
# @param [Boolean] force
|
767
|
+
# When `true`, deleting a message also deletes its threaded replies. When `false`
|
768
|
+
# , if a message has threaded replies, deletion fails. Only applies when [
|
769
|
+
# authenticating as a user](https://developers.google.com/chat/api/guides/auth/
|
770
|
+
# users). Has no effect when [authenticating with a service account] (https://
|
771
|
+
# developers.google.com/chat/api/guides/auth/service-accounts).
|
350
772
|
# @param [String] fields
|
351
773
|
# Selector specifying which fields to include in a partial response.
|
352
774
|
# @param [String] quota_user
|
@@ -364,30 +786,29 @@ module Google
|
|
364
786
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
365
787
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
366
788
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
367
|
-
def delete_space_message(name, fields: nil, quota_user: nil, options: nil, &block)
|
789
|
+
def delete_space_message(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
|
368
790
|
command = make_simple_command(:delete, 'v1/{+name}', options)
|
369
791
|
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
370
792
|
command.response_class = Google::Apis::ChatV1::Empty
|
371
793
|
command.params['name'] = name unless name.nil?
|
794
|
+
command.query['force'] = force unless force.nil?
|
372
795
|
command.query['fields'] = fields unless fields.nil?
|
373
796
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
374
797
|
execute_or_queue_command(command, &block)
|
375
798
|
end
|
376
799
|
|
377
|
-
# Returns a message. For example
|
378
|
-
# google.com/chat/api/guides/
|
800
|
+
# Returns details about a message. For an example, see [Read a message](https://
|
801
|
+
# developers.google.com/chat/api/guides/v1/messages/get). Requires [
|
379
802
|
# authentication](https://developers.google.com/chat/api/guides/auth). Fully
|
380
|
-
# supports [
|
381
|
-
# api/guides/auth/service-accounts)
|
382
|
-
#
|
383
|
-
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
# messages` or `chat.messages.readonly` authorization scope. Note: Might return
|
387
|
-
# a message from a blocked member or space.
|
803
|
+
# supports [service account authentication](https://developers.google.com/chat/
|
804
|
+
# api/guides/auth/service-accounts) and [user authentication](https://developers.
|
805
|
+
# google.com/chat/api/guides/auth/users). [User authentication](https://
|
806
|
+
# developers.google.com/chat/api/guides/auth/users) requires the `chat.messages`
|
807
|
+
# or `chat.messages.readonly` authorization scope. Note: Might return a message
|
808
|
+
# from a blocked member or space.
|
388
809
|
# @param [String] name
|
389
|
-
# Required. Resource name of the message to retrieve. Format: spaces/`space`/
|
390
|
-
# messages/`message
|
810
|
+
# Required. Resource name of the message to retrieve. Format: `spaces/`space`/
|
811
|
+
# messages/`message`` If the message begins with `client-`, then it has a custom
|
391
812
|
# name assigned by a Chat app that created it with the Chat REST API. That Chat
|
392
813
|
# app (but not others) can pass the custom name to get, update, or delete the
|
393
814
|
# message. To learn more, see [create and name a message] (https://developers.
|
@@ -419,16 +840,92 @@ module Google
|
|
419
840
|
execute_or_queue_command(command, &block)
|
420
841
|
end
|
421
842
|
|
422
|
-
#
|
423
|
-
#
|
424
|
-
#
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
843
|
+
# Lists messages in a space that the caller is a member of, including messages
|
844
|
+
# from blocked members and spaces. For an example, see [List messages](/chat/api/
|
845
|
+
# guides/v1/messages/list). Requires [user authentication](https://developers.
|
846
|
+
# google.com/chat/api/guides/auth/users) and the `chat.messages` or `chat.
|
847
|
+
# messages.readonly` authorization scope. This method is only supported in
|
848
|
+
# spaces that don't allow users from outside the Workspace organization to join.
|
849
|
+
# @param [String] parent
|
850
|
+
# Required. The resource name of the space to list messages from. Format: `
|
851
|
+
# spaces/`space``
|
852
|
+
# @param [String] filter
|
853
|
+
# A query filter. You can filter messages by date (`create_time`) and thread (`
|
854
|
+
# thread.name`). To filter messages by the date they were created, specify the `
|
855
|
+
# create_time` with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/
|
856
|
+
# rfc3339) format and double quotation marks. For example, `"2023-04-21T11:30:00-
|
857
|
+
# 04:00"`. You can use the greater than operator `>` to list messages that were
|
858
|
+
# created after a timestamp, or the less than operator `<` to list messages that
|
859
|
+
# were created before a timestamp. To filter messages within a time interval,
|
860
|
+
# use the `AND` operator between two timestamps. To filter by thread, specify
|
861
|
+
# the `thread.name`, formatted as `spaces/`space`/threads/`thread``. You can
|
862
|
+
# only specify one `thread.name` per query. To filter by both thread and date,
|
863
|
+
# use the `AND` operator in your query. For example, the following queries are
|
864
|
+
# valid: ``` create_time > "2012-04-21T11:30:00-04:00" create_time > "2012-04-
|
865
|
+
# 21T11:30:00-04:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123
|
866
|
+
# create_time > "2012-04-21T11:30:00+00:00" AND create_time < "2013-01-01T00:00:
|
867
|
+
# 00+00:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123 thread.name =
|
868
|
+
# spaces/AAAAAAAAAAA/threads/123 ``` Invalid queries are rejected by the server
|
869
|
+
# with an `INVALID_ARGUMENT` error.
|
870
|
+
# @param [String] order_by
|
871
|
+
# Optional, if resuming from a previous query. How the list of messages is
|
872
|
+
# ordered. Specify a value to order by an ordering operation. Valid ordering
|
873
|
+
# operation values are as follows: - `ASC` for ascending. - `DESC` for
|
874
|
+
# descending. The default ordering is `create_time ASC`.
|
875
|
+
# @param [Fixnum] page_size
|
876
|
+
# The maximum number of messages returned. The service might return fewer
|
877
|
+
# messages than this value. If unspecified, at most 25 are returned. The maximum
|
878
|
+
# value is 1,000. If you use a value more than 1,000, it's automatically changed
|
879
|
+
# to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
880
|
+
# @param [String] page_token
|
881
|
+
# Optional, if resuming from a previous query. A page token received from a
|
882
|
+
# previous list messages call. Provide this parameter to retrieve the subsequent
|
883
|
+
# page. When paginating, all other parameters provided should match the call
|
884
|
+
# that provided the page token. Passing different values to the other parameters
|
885
|
+
# might lead to unexpected results.
|
886
|
+
# @param [Boolean] show_deleted
|
887
|
+
# Whether to include deleted messages. Deleted messages include deleted time and
|
888
|
+
# metadata about their deletion, but message content is unavailable.
|
889
|
+
# @param [String] fields
|
890
|
+
# Selector specifying which fields to include in a partial response.
|
891
|
+
# @param [String] quota_user
|
892
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
893
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
894
|
+
# @param [Google::Apis::RequestOptions] options
|
895
|
+
# Request-specific options
|
896
|
+
#
|
897
|
+
# @yield [result, err] Result & error if block supplied
|
898
|
+
# @yieldparam result [Google::Apis::ChatV1::ListMessagesResponse] parsed result object
|
899
|
+
# @yieldparam err [StandardError] error object if request failed
|
900
|
+
#
|
901
|
+
# @return [Google::Apis::ChatV1::ListMessagesResponse]
|
902
|
+
#
|
903
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
904
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
905
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
906
|
+
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)
|
907
|
+
command = make_simple_command(:get, 'v1/{+parent}/messages', options)
|
908
|
+
command.response_representation = Google::Apis::ChatV1::ListMessagesResponse::Representation
|
909
|
+
command.response_class = Google::Apis::ChatV1::ListMessagesResponse
|
910
|
+
command.params['parent'] = parent unless parent.nil?
|
911
|
+
command.query['filter'] = filter unless filter.nil?
|
912
|
+
command.query['orderBy'] = order_by unless order_by.nil?
|
913
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
914
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
915
|
+
command.query['showDeleted'] = show_deleted unless show_deleted.nil?
|
916
|
+
command.query['fields'] = fields unless fields.nil?
|
917
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
918
|
+
execute_or_queue_command(command, &block)
|
919
|
+
end
|
920
|
+
|
921
|
+
# Updates a message. There's a difference between the `patch` and `update`
|
922
|
+
# methods. The `patch` method uses a `patch` request while the `update` method
|
923
|
+
# uses a `put` request. We recommend using the `patch` method. For an example,
|
924
|
+
# see [Update a message](https://developers.google.com/chat/api/guides/v1/
|
925
|
+
# messages/update). Requires [authentication](https://developers.google.com/chat/
|
926
|
+
# api/guides/auth). Fully supports [service account authentication](https://
|
927
|
+
# developers.google.com/chat/api/guides/auth/service-accounts) and [user
|
928
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users). [
|
432
929
|
# User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
433
930
|
# requires the `chat.messages` authorization scope.
|
434
931
|
# @param [String] name
|
@@ -436,14 +933,16 @@ module Google
|
|
436
933
|
# messages/BBBBBBBBBBB.BBBBBBBBBBB`
|
437
934
|
# @param [Google::Apis::ChatV1::Message] message_object
|
438
935
|
# @param [Boolean] allow_missing
|
439
|
-
# Optional. If `true` and the message
|
440
|
-
#
|
936
|
+
# Optional. If `true` and the message isn't found, a new message is created and `
|
937
|
+
# updateMask` is ignored. The specified message ID must be [client-assigned](
|
441
938
|
# https://developers.google.com/chat/api/guides/crudl/messages#
|
442
939
|
# name_a_created_message) or the request fails.
|
443
940
|
# @param [String] update_mask
|
444
941
|
# Required. The field paths to update. Separate multiple values with commas.
|
445
|
-
# Currently supported field paths: - text - cards (Requires [service account
|
446
|
-
# authentication](/chat/api/guides/auth/service-accounts).) - cards_v2
|
942
|
+
# Currently supported field paths: - `text` - `cards` (Requires [service account
|
943
|
+
# authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (
|
944
|
+
# Requires [service account authentication](/chat/api/guides/auth/service-
|
945
|
+
# accounts).)
|
447
946
|
# @param [String] fields
|
448
947
|
# Selector specifying which fields to include in a partial response.
|
449
948
|
# @param [String] quota_user
|
@@ -475,16 +974,14 @@ module Google
|
|
475
974
|
execute_or_queue_command(command, &block)
|
476
975
|
end
|
477
976
|
|
478
|
-
# Updates a message. There's a difference between `patch` and `update`
|
479
|
-
# The `patch` method uses a `patch` request while the `update` method
|
480
|
-
# put` request. We recommend using the `patch` method. For example
|
481
|
-
# Update a message](https://developers.google.com/chat/api/guides/
|
482
|
-
#
|
483
|
-
#
|
484
|
-
#
|
485
|
-
# authentication](https://developers.google.com/chat/api/guides/auth/users)
|
486
|
-
# part of the [Google Workspace Developer Preview Program](https://developers.
|
487
|
-
# google.com/workspace/preview), which grants early access to certain features. [
|
977
|
+
# Updates a message. There's a difference between the `patch` and `update`
|
978
|
+
# methods. The `patch` method uses a `patch` request while the `update` method
|
979
|
+
# uses a `put` request. We recommend using the `patch` method. For an example,
|
980
|
+
# see [Update a message](https://developers.google.com/chat/api/guides/v1/
|
981
|
+
# messages/update). Requires [authentication](https://developers.google.com/chat/
|
982
|
+
# api/guides/auth). Fully supports [service account authentication](https://
|
983
|
+
# developers.google.com/chat/api/guides/auth/service-accounts) and [user
|
984
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users). [
|
488
985
|
# User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
489
986
|
# requires the `chat.messages` authorization scope.
|
490
987
|
# @param [String] name
|
@@ -492,14 +989,16 @@ module Google
|
|
492
989
|
# messages/BBBBBBBBBBB.BBBBBBBBBBB`
|
493
990
|
# @param [Google::Apis::ChatV1::Message] message_object
|
494
991
|
# @param [Boolean] allow_missing
|
495
|
-
# Optional. If `true` and the message
|
496
|
-
#
|
992
|
+
# Optional. If `true` and the message isn't found, a new message is created and `
|
993
|
+
# updateMask` is ignored. The specified message ID must be [client-assigned](
|
497
994
|
# https://developers.google.com/chat/api/guides/crudl/messages#
|
498
995
|
# name_a_created_message) or the request fails.
|
499
996
|
# @param [String] update_mask
|
500
997
|
# Required. The field paths to update. Separate multiple values with commas.
|
501
|
-
# Currently supported field paths: - text - cards (Requires [service account
|
502
|
-
# authentication](/chat/api/guides/auth/service-accounts).) - cards_v2
|
998
|
+
# Currently supported field paths: - `text` - `cards` (Requires [service account
|
999
|
+
# authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (
|
1000
|
+
# Requires [service account authentication](/chat/api/guides/auth/service-
|
1001
|
+
# accounts).)
|
503
1002
|
# @param [String] fields
|
504
1003
|
# Selector specifying which fields to include in a partial response.
|
505
1004
|
# @param [String] quota_user
|
@@ -533,11 +1032,13 @@ module Google
|
|
533
1032
|
|
534
1033
|
# Gets the metadata of a message attachment. The attachment data is fetched
|
535
1034
|
# using the [media API](https://developers.google.com/chat/api/reference/rest/v1/
|
536
|
-
# media/download).
|
537
|
-
# google.com/chat/api/guides/
|
1035
|
+
# media/download). For an example, see [Get a message attachment](https://
|
1036
|
+
# developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [
|
1037
|
+
# service account authentication](https://developers.google.com/chat/api/guides/
|
1038
|
+
# auth/service-accounts).
|
538
1039
|
# @param [String] name
|
539
|
-
# Required. Resource name of the attachment, in the form
|
540
|
-
# attachments
|
1040
|
+
# Required. Resource name of the attachment, in the form `spaces/*/messages/*/
|
1041
|
+
# attachments/*`.
|
541
1042
|
# @param [String] fields
|
542
1043
|
# Selector specifying which fields to include in a partial response.
|
543
1044
|
# @param [String] quota_user
|
@@ -564,6 +1065,146 @@ module Google
|
|
564
1065
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
565
1066
|
execute_or_queue_command(command, &block)
|
566
1067
|
end
|
1068
|
+
|
1069
|
+
# Creates a reaction and adds it to a message. For an example, see [Create a
|
1070
|
+
# reaction](https://developers.google.com/chat/api/guides/v1/reactions/create).
|
1071
|
+
# Requires [user authentication](https://developers.google.com/chat/api/guides/
|
1072
|
+
# auth/users) and the `chat.messages`, `chat.messages.reactions`, or `chat.
|
1073
|
+
# messages.reactions.create` scope. Only unicode emoji are supported.
|
1074
|
+
# @param [String] parent
|
1075
|
+
# Required. The message where the reaction is created. Format: `spaces/`space`/
|
1076
|
+
# messages/`message``
|
1077
|
+
# @param [Google::Apis::ChatV1::Reaction] reaction_object
|
1078
|
+
# @param [String] fields
|
1079
|
+
# Selector specifying which fields to include in a partial response.
|
1080
|
+
# @param [String] quota_user
|
1081
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1082
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1083
|
+
# @param [Google::Apis::RequestOptions] options
|
1084
|
+
# Request-specific options
|
1085
|
+
#
|
1086
|
+
# @yield [result, err] Result & error if block supplied
|
1087
|
+
# @yieldparam result [Google::Apis::ChatV1::Reaction] parsed result object
|
1088
|
+
# @yieldparam err [StandardError] error object if request failed
|
1089
|
+
#
|
1090
|
+
# @return [Google::Apis::ChatV1::Reaction]
|
1091
|
+
#
|
1092
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1093
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1094
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1095
|
+
def create_space_message_reaction(parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
1096
|
+
command = make_simple_command(:post, 'v1/{+parent}/reactions', options)
|
1097
|
+
command.request_representation = Google::Apis::ChatV1::Reaction::Representation
|
1098
|
+
command.request_object = reaction_object
|
1099
|
+
command.response_representation = Google::Apis::ChatV1::Reaction::Representation
|
1100
|
+
command.response_class = Google::Apis::ChatV1::Reaction
|
1101
|
+
command.params['parent'] = parent unless parent.nil?
|
1102
|
+
command.query['fields'] = fields unless fields.nil?
|
1103
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1104
|
+
execute_or_queue_command(command, &block)
|
1105
|
+
end
|
1106
|
+
|
1107
|
+
# Deletes a reaction to a message. For an example, see [Delete a reaction](https:
|
1108
|
+
# //developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user
|
1109
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) and
|
1110
|
+
# the `chat.messages` or `chat.messages.reactions` scope.
|
1111
|
+
# @param [String] name
|
1112
|
+
# Required. Name of the reaction to delete. Format: `spaces/`space`/messages/`
|
1113
|
+
# message`/reactions/`reaction``
|
1114
|
+
# @param [String] fields
|
1115
|
+
# Selector specifying which fields to include in a partial response.
|
1116
|
+
# @param [String] quota_user
|
1117
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1118
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1119
|
+
# @param [Google::Apis::RequestOptions] options
|
1120
|
+
# Request-specific options
|
1121
|
+
#
|
1122
|
+
# @yield [result, err] Result & error if block supplied
|
1123
|
+
# @yieldparam result [Google::Apis::ChatV1::Empty] parsed result object
|
1124
|
+
# @yieldparam err [StandardError] error object if request failed
|
1125
|
+
#
|
1126
|
+
# @return [Google::Apis::ChatV1::Empty]
|
1127
|
+
#
|
1128
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1129
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1130
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1131
|
+
def delete_space_message_reaction(name, fields: nil, quota_user: nil, options: nil, &block)
|
1132
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
1133
|
+
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
1134
|
+
command.response_class = Google::Apis::ChatV1::Empty
|
1135
|
+
command.params['name'] = name unless name.nil?
|
1136
|
+
command.query['fields'] = fields unless fields.nil?
|
1137
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1138
|
+
execute_or_queue_command(command, &block)
|
1139
|
+
end
|
1140
|
+
|
1141
|
+
# Lists reactions to a message. For an example, see [List reactions](https://
|
1142
|
+
# developers.google.com/chat/api/guides/v1/reactions/list). Requires [user
|
1143
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users) and `
|
1144
|
+
# chat.messages`, `chat.messages.readonly`, `chat.messages.reactions`, or `chat.
|
1145
|
+
# messages.reactions.readonly` scope.
|
1146
|
+
# @param [String] parent
|
1147
|
+
# Required. The message users reacted to. Format: `spaces/`space`/messages/`
|
1148
|
+
# message``
|
1149
|
+
# @param [String] filter
|
1150
|
+
# Optional. A query filter. You can filter reactions by [emoji](https://
|
1151
|
+
# developers.google.com/chat/api/reference/rest/v1/Emoji) (either `emoji.unicode`
|
1152
|
+
# or `emoji.custom_emoji.uid`) and [user](https://developers.google.com/chat/
|
1153
|
+
# api/reference/rest/v1/User) (`user.name`). To filter reactions for multiple
|
1154
|
+
# emojis or users, join similar fields with the `OR` operator, such as `emoji.
|
1155
|
+
# unicode = "🙂" OR emoji.unicode = "👍"` and `user.name = "users/AAAAAA" OR user.
|
1156
|
+
# name = "users/BBBBBB"`. To filter reactions by emoji and user, use the `AND`
|
1157
|
+
# operator, such as `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. If
|
1158
|
+
# your query uses both `AND` and `OR`, group them with parentheses. For example,
|
1159
|
+
# the following queries are valid: ``` user.name = "users/`user`" emoji.unicode =
|
1160
|
+
# "🙂" emoji.custom_emoji.uid = "`uid`" emoji.unicode = "🙂" OR emoji.unicode = "👍
|
1161
|
+
# " emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "`uid`" emoji.unicode = "🙂"
|
1162
|
+
# AND user.name = "users/`user`" (emoji.unicode = "🙂" OR emoji.custom_emoji.uid =
|
1163
|
+
# "`uid`") AND user.name = "users/`user`" ``` The following queries are invalid:
|
1164
|
+
# ``` emoji.unicode = "🙂" AND emoji.unicode = "👍" emoji.unicode = "🙂" AND emoji.
|
1165
|
+
# custom_emoji.uid = "`uid`" emoji.unicode = "🙂" OR user.name = "users/`user`"
|
1166
|
+
# emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "`uid`" OR user.name = "users/`
|
1167
|
+
# user`" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "`uid`" AND user.name =
|
1168
|
+
# "users/`user`" ``` Invalid queries are rejected by the server with an `
|
1169
|
+
# INVALID_ARGUMENT` error.
|
1170
|
+
# @param [Fixnum] page_size
|
1171
|
+
# Optional. The maximum number of reactions returned. The service can return
|
1172
|
+
# fewer reactions than this value. If unspecified, the default value is 25. The
|
1173
|
+
# maximum value is 200; values above 200 are changed to 200.
|
1174
|
+
# @param [String] page_token
|
1175
|
+
# Optional. (If resuming from a previous query.) A page token received from a
|
1176
|
+
# previous list reactions call. Provide this to retrieve the subsequent page.
|
1177
|
+
# When paginating, the filter value should match the call that provided the page
|
1178
|
+
# token. Passing a different value might lead to unexpected results.
|
1179
|
+
# @param [String] fields
|
1180
|
+
# Selector specifying which fields to include in a partial response.
|
1181
|
+
# @param [String] quota_user
|
1182
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1183
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1184
|
+
# @param [Google::Apis::RequestOptions] options
|
1185
|
+
# Request-specific options
|
1186
|
+
#
|
1187
|
+
# @yield [result, err] Result & error if block supplied
|
1188
|
+
# @yieldparam result [Google::Apis::ChatV1::ListReactionsResponse] parsed result object
|
1189
|
+
# @yieldparam err [StandardError] error object if request failed
|
1190
|
+
#
|
1191
|
+
# @return [Google::Apis::ChatV1::ListReactionsResponse]
|
1192
|
+
#
|
1193
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1194
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1195
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1196
|
+
def list_space_message_reactions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
1197
|
+
command = make_simple_command(:get, 'v1/{+parent}/reactions', options)
|
1198
|
+
command.response_representation = Google::Apis::ChatV1::ListReactionsResponse::Representation
|
1199
|
+
command.response_class = Google::Apis::ChatV1::ListReactionsResponse
|
1200
|
+
command.params['parent'] = parent unless parent.nil?
|
1201
|
+
command.query['filter'] = filter unless filter.nil?
|
1202
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
1203
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
1204
|
+
command.query['fields'] = fields unless fields.nil?
|
1205
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1206
|
+
execute_or_queue_command(command, &block)
|
1207
|
+
end
|
567
1208
|
|
568
1209
|
protected
|
569
1210
|
|