google-apis-chat_v1 0.44.0 → 0.69.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 +104 -0
- data/lib/google/apis/chat_v1/classes.rb +1520 -404
- data/lib/google/apis/chat_v1/gem_version.rb +3 -3
- data/lib/google/apis/chat_v1/representations.rb +317 -1
- data/lib/google/apis/chat_v1/service.rb +728 -246
- data/lib/google/apis/chat_v1.rb +45 -0
- metadata +6 -6
@@ -50,110 +50,106 @@ module Google
|
|
50
50
|
@batch_path = 'batch'
|
51
51
|
end
|
52
52
|
|
53
|
-
#
|
54
|
-
#
|
55
|
-
# @param [String]
|
56
|
-
#
|
57
|
-
# AAAAAAAAAAA
|
58
|
-
# @param [Google::Apis::ChatV1::Message] message_object
|
59
|
-
# @param [String] request_id
|
60
|
-
# Optional. A unique request ID for this message. Specifying an existing request
|
61
|
-
# ID returns the message created with that ID instead of creating a new message.
|
62
|
-
# @param [String] thread_key
|
63
|
-
# Optional. Opaque thread identifier. To start or add to a thread, create a
|
64
|
-
# message and specify a `threadKey` instead of thread.name. (Setting thread.name
|
65
|
-
# has no effect.) The first message with a given `threadKey` starts a new thread.
|
66
|
-
# Subsequent messages with the same `threadKey` post into the same thread.
|
53
|
+
# Downloads media. Download is supported on the URI `/v1/media/`+name`?alt=media`
|
54
|
+
# .
|
55
|
+
# @param [String] resource_name
|
56
|
+
# Name of the media that is being downloaded. See ReadRequest.resource_name.
|
67
57
|
# @param [String] fields
|
68
58
|
# Selector specifying which fields to include in a partial response.
|
69
59
|
# @param [String] quota_user
|
70
60
|
# Available to use for quota purposes for server-side applications. Can be any
|
71
61
|
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
62
|
+
# @param [IO, String] download_dest
|
63
|
+
# IO stream or filename to receive content download
|
72
64
|
# @param [Google::Apis::RequestOptions] options
|
73
65
|
# Request-specific options
|
74
66
|
#
|
75
67
|
# @yield [result, err] Result & error if block supplied
|
76
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
68
|
+
# @yieldparam result [Google::Apis::ChatV1::Media] parsed result object
|
77
69
|
# @yieldparam err [StandardError] error object if request failed
|
78
70
|
#
|
79
|
-
# @return [Google::Apis::ChatV1::
|
71
|
+
# @return [Google::Apis::ChatV1::Media]
|
80
72
|
#
|
81
73
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
82
74
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
83
75
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
84
|
-
def
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
command.
|
92
|
-
command.
|
76
|
+
def download_medium(resource_name, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
|
77
|
+
if download_dest.nil?
|
78
|
+
command = make_simple_command(:get, 'v1/media/{+resourceName}', options)
|
79
|
+
else
|
80
|
+
command = make_download_command(:get, 'v1/media/{+resourceName}', options)
|
81
|
+
command.download_dest = download_dest
|
82
|
+
end
|
83
|
+
command.response_representation = Google::Apis::ChatV1::Media::Representation
|
84
|
+
command.response_class = Google::Apis::ChatV1::Media
|
85
|
+
command.params['resourceName'] = resource_name unless resource_name.nil?
|
93
86
|
command.query['fields'] = fields unless fields.nil?
|
94
87
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
95
88
|
execute_or_queue_command(command, &block)
|
96
89
|
end
|
97
90
|
|
98
|
-
#
|
99
|
-
#
|
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). You can upload attachments up to 200 MB. Certain file types aren'
|
95
|
+
# t supported. For details, see [File types blocked by Google Chat](https://
|
96
|
+
# support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%
|
97
|
+
# 20types%20blocked%20in%20Google%20Chat).
|
100
98
|
# @param [String] parent
|
101
|
-
# Required.
|
102
|
-
#
|
103
|
-
# @param [Google::Apis::ChatV1::
|
104
|
-
# @param [String] request_id
|
105
|
-
# Optional. A unique request ID for this message. Specifying an existing request
|
106
|
-
# ID returns the message created with that ID instead of creating a new message.
|
107
|
-
# @param [String] thread_key
|
108
|
-
# Optional. Opaque thread identifier. To start or add to a thread, create a
|
109
|
-
# message and specify a `threadKey` instead of thread.name. (Setting thread.name
|
110
|
-
# has no effect.) The first message with a given `threadKey` starts a new thread.
|
111
|
-
# Subsequent messages with the same `threadKey` post into the same thread.
|
99
|
+
# Required. Resource name of the Chat space in which the attachment is uploaded.
|
100
|
+
# Format "spaces/`space`".
|
101
|
+
# @param [Google::Apis::ChatV1::UploadAttachmentRequest] upload_attachment_request_object
|
112
102
|
# @param [String] fields
|
113
103
|
# Selector specifying which fields to include in a partial response.
|
114
104
|
# @param [String] quota_user
|
115
105
|
# Available to use for quota purposes for server-side applications. Can be any
|
116
106
|
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
107
|
+
# @param [IO, String] upload_source
|
108
|
+
# IO stream or filename containing content to upload
|
109
|
+
# @param [String] content_type
|
110
|
+
# Content type of the uploaded content.
|
117
111
|
# @param [Google::Apis::RequestOptions] options
|
118
112
|
# Request-specific options
|
119
113
|
#
|
120
114
|
# @yield [result, err] Result & error if block supplied
|
121
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
115
|
+
# @yieldparam result [Google::Apis::ChatV1::UploadAttachmentResponse] parsed result object
|
122
116
|
# @yieldparam err [StandardError] error object if request failed
|
123
117
|
#
|
124
|
-
# @return [Google::Apis::ChatV1::
|
118
|
+
# @return [Google::Apis::ChatV1::UploadAttachmentResponse]
|
125
119
|
#
|
126
120
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
127
121
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
128
122
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
129
|
-
def
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
123
|
+
def upload_medium_attachment(parent, upload_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
|
124
|
+
if upload_source.nil?
|
125
|
+
command = make_simple_command(:post, 'v1/{+parent}/attachments:upload', options)
|
126
|
+
else
|
127
|
+
command = make_upload_command(:post, 'v1/{+parent}/attachments:upload', options)
|
128
|
+
command.upload_source = upload_source
|
129
|
+
command.upload_content_type = content_type
|
130
|
+
end
|
131
|
+
command.request_representation = Google::Apis::ChatV1::UploadAttachmentRequest::Representation
|
132
|
+
command.request_object = upload_attachment_request_object
|
133
|
+
command.response_representation = Google::Apis::ChatV1::UploadAttachmentResponse::Representation
|
134
|
+
command.response_class = Google::Apis::ChatV1::UploadAttachmentResponse
|
135
135
|
command.params['parent'] = parent unless parent.nil?
|
136
|
-
command.query['requestId'] = request_id unless request_id.nil?
|
137
|
-
command.query['threadKey'] = thread_key unless thread_key.nil?
|
138
136
|
command.query['fields'] = fields unless fields.nil?
|
139
137
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
140
138
|
execute_or_queue_command(command, &block)
|
141
139
|
end
|
142
140
|
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
141
|
+
# Creates a named space. Spaces grouped by topics aren't supported. For an
|
142
|
+
# example, see [Create a space](https://developers.google.com/chat/api/guides/v1/
|
143
|
+
# spaces/create). If you receive the error message `ALREADY_EXISTS` when
|
144
|
+
# creating a space, try a different `displayName`. An existing space within the
|
145
|
+
# Google Workspace organization might already use this display name. Requires [
|
146
|
+
# user authentication](https://developers.google.com/chat/api/guides/auth/users).
|
147
|
+
# @param [Google::Apis::ChatV1::Space] space_object
|
149
148
|
# @param [String] request_id
|
150
|
-
# Optional. A unique
|
151
|
-
# ID returns the
|
152
|
-
#
|
153
|
-
#
|
154
|
-
# message and specify a `threadKey` instead of thread.name. (Setting thread.name
|
155
|
-
# has no effect.) The first message with a given `threadKey` starts a new thread.
|
156
|
-
# Subsequent messages with the same `threadKey` post into the same thread.
|
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.
|
157
153
|
# @param [String] fields
|
158
154
|
# Selector specifying which fields to include in a partial response.
|
159
155
|
# @param [String] quota_user
|
@@ -163,80 +159,83 @@ module Google
|
|
163
159
|
# Request-specific options
|
164
160
|
#
|
165
161
|
# @yield [result, err] Result & error if block supplied
|
166
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
162
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
167
163
|
# @yieldparam err [StandardError] error object if request failed
|
168
164
|
#
|
169
|
-
# @return [Google::Apis::ChatV1::
|
165
|
+
# @return [Google::Apis::ChatV1::Space]
|
170
166
|
#
|
171
167
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
172
168
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
173
169
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
174
|
-
def
|
175
|
-
command = make_simple_command(:post, 'v1/
|
176
|
-
command.request_representation = Google::Apis::ChatV1::
|
177
|
-
command.request_object =
|
178
|
-
command.response_representation = Google::Apis::ChatV1::
|
179
|
-
command.response_class = Google::Apis::ChatV1::
|
180
|
-
command.params['parent'] = parent unless parent.nil?
|
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
|
181
176
|
command.query['requestId'] = request_id unless request_id.nil?
|
182
|
-
command.query['threadKey'] = thread_key unless thread_key.nil?
|
183
177
|
command.query['fields'] = fields unless fields.nil?
|
184
178
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
185
179
|
execute_or_queue_command(command, &block)
|
186
180
|
end
|
187
181
|
|
188
|
-
#
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
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.
|
188
|
+
# @param [String] name
|
189
|
+
# Required. Resource name of the space to delete. Format: `spaces/`space``
|
192
190
|
# @param [String] fields
|
193
191
|
# Selector specifying which fields to include in a partial response.
|
194
192
|
# @param [String] quota_user
|
195
193
|
# Available to use for quota purposes for server-side applications. Can be any
|
196
194
|
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
197
|
-
# @param [IO, String] download_dest
|
198
|
-
# IO stream or filename to receive content download
|
199
195
|
# @param [Google::Apis::RequestOptions] options
|
200
196
|
# Request-specific options
|
201
197
|
#
|
202
198
|
# @yield [result, err] Result & error if block supplied
|
203
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
199
|
+
# @yieldparam result [Google::Apis::ChatV1::Empty] parsed result object
|
204
200
|
# @yieldparam err [StandardError] error object if request failed
|
205
201
|
#
|
206
|
-
# @return [Google::Apis::ChatV1::
|
202
|
+
# @return [Google::Apis::ChatV1::Empty]
|
207
203
|
#
|
208
204
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
209
205
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
210
206
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
211
|
-
def
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
command.download_dest = download_dest
|
217
|
-
end
|
218
|
-
command.response_representation = Google::Apis::ChatV1::Media::Representation
|
219
|
-
command.response_class = Google::Apis::ChatV1::Media
|
220
|
-
command.params['resourceName'] = resource_name unless resource_name.nil?
|
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?
|
221
212
|
command.query['fields'] = fields unless fields.nil?
|
222
213
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
223
214
|
execute_or_queue_command(command, &block)
|
224
215
|
end
|
225
216
|
|
226
|
-
#
|
227
|
-
#
|
228
|
-
#
|
229
|
-
#
|
230
|
-
#
|
231
|
-
#
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
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`. When [authenticated as a
|
236
|
+
# user](https://developers.google.com/chat/api/guides/auth/users), you can use
|
237
|
+
# the email as an alias for ``user``. For example, `users/example@gmail.com`
|
238
|
+
# where `example@gmail.com` is the email of the Google Chat user.
|
240
239
|
# @param [String] fields
|
241
240
|
# Selector specifying which fields to include in a partial response.
|
242
241
|
# @param [String] quota_user
|
@@ -246,42 +245,34 @@ module Google
|
|
246
245
|
# Request-specific options
|
247
246
|
#
|
248
247
|
# @yield [result, err] Result & error if block supplied
|
249
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
248
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
250
249
|
# @yieldparam err [StandardError] error object if request failed
|
251
250
|
#
|
252
|
-
# @return [Google::Apis::ChatV1::
|
251
|
+
# @return [Google::Apis::ChatV1::Space]
|
253
252
|
#
|
254
253
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
255
254
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
256
255
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
257
|
-
def
|
258
|
-
command = make_simple_command(:
|
259
|
-
command.
|
260
|
-
command.
|
261
|
-
command.
|
262
|
-
command.response_class = Google::Apis::ChatV1::Message
|
263
|
-
command.params['parent'] = parent unless parent.nil?
|
264
|
-
command.query['requestId'] = request_id unless request_id.nil?
|
265
|
-
command.query['threadKey'] = thread_key unless thread_key.nil?
|
256
|
+
def find_space_direct_message(name: nil, fields: nil, quota_user: nil, options: nil, &block)
|
257
|
+
command = make_simple_command(:get, 'v1/spaces:findDirectMessage', options)
|
258
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
259
|
+
command.response_class = Google::Apis::ChatV1::Space
|
260
|
+
command.query['name'] = name unless name.nil?
|
266
261
|
command.query['fields'] = fields unless fields.nil?
|
267
262
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
268
263
|
execute_or_queue_command(command, &block)
|
269
264
|
end
|
270
265
|
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
# Optional. Opaque thread identifier. To start or add to a thread, create a
|
282
|
-
# message and specify a `threadKey` instead of thread.name. (Setting thread.name
|
283
|
-
# has no effect.) The first message with a given `threadKey` starts a new thread.
|
284
|
-
# Subsequent messages with the same `threadKey` post into the same thread.
|
266
|
+
# Returns details about a space. For an example, see [Get a space](https://
|
267
|
+
# developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication]
|
268
|
+
# (https://developers.google.com/chat/api/guides/auth). Fully supports [service
|
269
|
+
# account authentication](https://developers.google.com/chat/api/guides/auth/
|
270
|
+
# service-accounts) and [user authentication](https://developers.google.com/chat/
|
271
|
+
# api/guides/auth/users). [User authentication](https://developers.google.com/
|
272
|
+
# chat/api/guides/auth/users).
|
273
|
+
# @param [String] name
|
274
|
+
# Required. Resource name of the space, in the form "spaces/*". Format: `spaces/`
|
275
|
+
# space``
|
285
276
|
# @param [String] fields
|
286
277
|
# Selector specifying which fields to include in a partial response.
|
287
278
|
# @param [String] quota_user
|
@@ -291,42 +282,57 @@ module Google
|
|
291
282
|
# Request-specific options
|
292
283
|
#
|
293
284
|
# @yield [result, err] Result & error if block supplied
|
294
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
285
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
295
286
|
# @yieldparam err [StandardError] error object if request failed
|
296
287
|
#
|
297
|
-
# @return [Google::Apis::ChatV1::
|
288
|
+
# @return [Google::Apis::ChatV1::Space]
|
298
289
|
#
|
299
290
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
300
291
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
301
292
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
302
|
-
def
|
303
|
-
command = make_simple_command(:
|
304
|
-
command.
|
305
|
-
command.
|
306
|
-
command.
|
307
|
-
command.response_class = Google::Apis::ChatV1::Message
|
308
|
-
command.params['parent'] = parent unless parent.nil?
|
309
|
-
command.query['requestId'] = request_id unless request_id.nil?
|
310
|
-
command.query['threadKey'] = thread_key unless thread_key.nil?
|
293
|
+
def get_space(name, fields: nil, quota_user: nil, options: nil, &block)
|
294
|
+
command = make_simple_command(:get, 'v1/{+name}', options)
|
295
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
296
|
+
command.response_class = Google::Apis::ChatV1::Space
|
297
|
+
command.params['name'] = name unless name.nil?
|
311
298
|
command.query['fields'] = fields unless fields.nil?
|
312
299
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
313
300
|
execute_or_queue_command(command, &block)
|
314
301
|
end
|
315
302
|
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
#
|
320
|
-
#
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
# @param [String]
|
326
|
-
# Optional.
|
327
|
-
#
|
328
|
-
#
|
329
|
-
#
|
303
|
+
# Lists spaces the caller is a member of. Group chats and DMs aren't listed
|
304
|
+
# until the first message is sent. For an example, see [List spaces](https://
|
305
|
+
# developers.google.com/chat/api/guides/v1/spaces/list). Requires [
|
306
|
+
# authentication](https://developers.google.com/chat/api/guides/auth). Fully
|
307
|
+
# supports [service account authentication](https://developers.google.com/chat/
|
308
|
+
# api/guides/auth/service-accounts) and [user authentication](https://developers.
|
309
|
+
# google.com/chat/api/guides/auth/users). Lists spaces visible to the caller or
|
310
|
+
# authenticated user. Group chats and DMs aren't listed until the first message
|
311
|
+
# is sent.
|
312
|
+
# @param [String] filter
|
313
|
+
# Optional. A query filter. Requires [user authentication](https://developers.
|
314
|
+
# google.com/chat/api/guides/auth/users). You can filter spaces by the space
|
315
|
+
# type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/
|
316
|
+
# spaces#spacetype)). To filter by space type, you must specify valid enum value,
|
317
|
+
# such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `
|
318
|
+
# SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
|
319
|
+
# operator. For example, the following queries are valid: ``` space_type = "
|
320
|
+
# SPACE" spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" ``` Invalid
|
321
|
+
# queries are rejected by the server with an `INVALID_ARGUMENT` error. With [
|
322
|
+
# service account authentication](https://developers.google.com/chat/api/guides/
|
323
|
+
# auth/service-accounts), this field is ignored and the query always returns all
|
324
|
+
# spaces. But the Chat API still validates the query syntax with service
|
325
|
+
# accounts, so invalid queries are still rejected.
|
326
|
+
# @param [Fixnum] page_size
|
327
|
+
# Optional. The maximum number of spaces to return. The service might return
|
328
|
+
# fewer than this value. If unspecified, at most 100 spaces are returned. The
|
329
|
+
# maximum value is 1,000. If you use a value more than 1,000, it's automatically
|
330
|
+
# changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
331
|
+
# @param [String] page_token
|
332
|
+
# Optional. A page token, received from a previous list spaces call. Provide
|
333
|
+
# this parameter to retrieve the subsequent page. When paginating, the filter
|
334
|
+
# value should match the call that provided the page token. Passing a different
|
335
|
+
# value may lead to unexpected results.
|
330
336
|
# @param [String] fields
|
331
337
|
# Selector specifying which fields to include in a partial response.
|
332
338
|
# @param [String] quota_user
|
@@ -336,33 +342,55 @@ module Google
|
|
336
342
|
# Request-specific options
|
337
343
|
#
|
338
344
|
# @yield [result, err] Result & error if block supplied
|
339
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
345
|
+
# @yieldparam result [Google::Apis::ChatV1::ListSpacesResponse] parsed result object
|
340
346
|
# @yieldparam err [StandardError] error object if request failed
|
341
347
|
#
|
342
|
-
# @return [Google::Apis::ChatV1::
|
348
|
+
# @return [Google::Apis::ChatV1::ListSpacesResponse]
|
343
349
|
#
|
344
350
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
345
351
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
346
352
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
347
|
-
def
|
348
|
-
command = make_simple_command(:
|
349
|
-
command.
|
350
|
-
command.
|
351
|
-
command.
|
352
|
-
command.
|
353
|
-
command.
|
354
|
-
command.query['requestId'] = request_id unless request_id.nil?
|
355
|
-
command.query['threadKey'] = thread_key unless thread_key.nil?
|
353
|
+
def list_spaces(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
354
|
+
command = make_simple_command(:get, 'v1/spaces', options)
|
355
|
+
command.response_representation = Google::Apis::ChatV1::ListSpacesResponse::Representation
|
356
|
+
command.response_class = Google::Apis::ChatV1::ListSpacesResponse
|
357
|
+
command.query['filter'] = filter unless filter.nil?
|
358
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
359
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
356
360
|
command.query['fields'] = fields unless fields.nil?
|
357
361
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
358
362
|
execute_or_queue_command(command, &block)
|
359
363
|
end
|
360
364
|
|
361
|
-
#
|
362
|
-
# google.com/chat/api/guides/
|
365
|
+
# Updates a space. For an example, see [Update a space](https://developers.
|
366
|
+
# google.com/chat/api/guides/v1/spaces/update). If you're updating the `
|
367
|
+
# displayName` field and receive the error message `ALREADY_EXISTS`, try a
|
368
|
+
# different display name.. An existing space within the Google Workspace
|
369
|
+
# organization might already use this display name. Requires [user
|
370
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users).
|
363
371
|
# @param [String] name
|
364
|
-
#
|
365
|
-
#
|
372
|
+
# Resource name of the space. Format: `spaces/`space``
|
373
|
+
# @param [Google::Apis::ChatV1::Space] space_object
|
374
|
+
# @param [String] update_mask
|
375
|
+
# Required. The updated field paths, comma separated if there are multiple.
|
376
|
+
# Currently supported field paths: - `display_name` (Only supports changing the
|
377
|
+
# display name of a space with the `SPACE` type, or when also including the `
|
378
|
+
# space_type` mask to change a `GROUP_CHAT` space type to `SPACE`. Trying to
|
379
|
+
# update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space results
|
380
|
+
# in an invalid argument error. If you receive the error message `ALREADY_EXISTS`
|
381
|
+
# when updating the `displayName`, try a different `displayName`. An existing
|
382
|
+
# space within the Google Workspace organization might already use this display
|
383
|
+
# name.) - `space_type` (Only supports changing a `GROUP_CHAT` space type to `
|
384
|
+
# SPACE`. Include `display_name` together with `space_type` in the update mask
|
385
|
+
# and ensure that the specified space has a non-empty display name and the `
|
386
|
+
# SPACE` space type. Including the `space_type` mask and the `SPACE` type in the
|
387
|
+
# specified space when updating the display name is optional if the existing
|
388
|
+
# space already has the `SPACE` type. Trying to update the space type in other
|
389
|
+
# ways results in an invalid argument error). - `space_details` - `
|
390
|
+
# space_history_state` (Supports [turning history on or off for the space](https:
|
391
|
+
# //support.google.com/chat/answer/7664687) if [the organization allows users to
|
392
|
+
# change their history setting](https://support.google.com/a/answer/7664184).
|
393
|
+
# Warning: mutually exclusive with all other field paths.)
|
366
394
|
# @param [String] fields
|
367
395
|
# Selector specifying which fields to include in a partial response.
|
368
396
|
# @param [String] quota_user
|
@@ -380,24 +408,48 @@ module Google
|
|
380
408
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
381
409
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
382
410
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
383
|
-
def
|
384
|
-
command = make_simple_command(:
|
411
|
+
def patch_space(name, space_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
412
|
+
command = make_simple_command(:patch, 'v1/{+name}', options)
|
413
|
+
command.request_representation = Google::Apis::ChatV1::Space::Representation
|
414
|
+
command.request_object = space_object
|
385
415
|
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
386
416
|
command.response_class = Google::Apis::ChatV1::Space
|
387
417
|
command.params['name'] = name unless name.nil?
|
418
|
+
command.query['updateMask'] = update_mask unless update_mask.nil?
|
388
419
|
command.query['fields'] = fields unless fields.nil?
|
389
420
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
390
421
|
execute_or_queue_command(command, &block)
|
391
422
|
end
|
392
423
|
|
393
|
-
#
|
394
|
-
#
|
395
|
-
#
|
396
|
-
#
|
397
|
-
#
|
398
|
-
#
|
399
|
-
#
|
400
|
-
#
|
424
|
+
# Creates a space and adds specified users to it. The calling user is
|
425
|
+
# automatically added to the space, and shouldn't be specified as a membership
|
426
|
+
# in the request. For an example, see [Set up a space](https://developers.google.
|
427
|
+
# com/chat/api/guides/v1/spaces/set-up). To specify the human members to add,
|
428
|
+
# add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`.
|
429
|
+
# To add a human user, use `users/`user``, where ``user`` can be the email
|
430
|
+
# address for the user. For users in the same Workspace organization ``user``
|
431
|
+
# can also be the ``person_id`` for the person from the People API, or the `id`
|
432
|
+
# for the user in the Directory API. For example, if the People API Person `
|
433
|
+
# resourceName` for `user@example.com` is `people/123456789`, you can add the
|
434
|
+
# user to the space by setting the `membership.member.name` to `users/user@
|
435
|
+
# example.com` or `users/123456789`. For a space or group chat, if the caller
|
436
|
+
# blocks or is blocked by some members, then those members aren't added to the
|
437
|
+
# created space. To create a direct message (DM) between the calling user and
|
438
|
+
# another human user, specify exactly one membership to represent the human user.
|
439
|
+
# If one user blocks the other, the request fails and the DM isn't created. To
|
440
|
+
# create a DM between the calling user and the calling app, set `Space.
|
441
|
+
# singleUserBotDm` to `true` and don't specify any memberships. You can only use
|
442
|
+
# this method to set up a DM with the calling app. To add the calling app as a
|
443
|
+
# member of a space or an existing DM between two human users, see [create a
|
444
|
+
# membership](https://developers.google.com/chat/api/guides/v1/members/create).
|
445
|
+
# If a DM already exists between two users, even when one user blocks the other
|
446
|
+
# at the time a request is made, then the existing DM is returned. Spaces with
|
447
|
+
# threaded replies aren't supported. If you receive the error message `
|
448
|
+
# ALREADY_EXISTS` when setting up a space, try a different `displayName`. An
|
449
|
+
# existing space within the Google Workspace organization might already use this
|
450
|
+
# display name. Requires [user authentication](https://developers.google.com/
|
451
|
+
# chat/api/guides/auth/users).
|
452
|
+
# @param [Google::Apis::ChatV1::SetUpSpaceRequest] set_up_space_request_object
|
401
453
|
# @param [String] fields
|
402
454
|
# Selector specifying which fields to include in a partial response.
|
403
455
|
# @param [String] quota_user
|
@@ -407,39 +459,46 @@ module Google
|
|
407
459
|
# Request-specific options
|
408
460
|
#
|
409
461
|
# @yield [result, err] Result & error if block supplied
|
410
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
462
|
+
# @yieldparam result [Google::Apis::ChatV1::Space] parsed result object
|
411
463
|
# @yieldparam err [StandardError] error object if request failed
|
412
464
|
#
|
413
|
-
# @return [Google::Apis::ChatV1::
|
465
|
+
# @return [Google::Apis::ChatV1::Space]
|
414
466
|
#
|
415
467
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
416
468
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
417
469
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
418
|
-
def
|
419
|
-
command = make_simple_command(:
|
420
|
-
command.
|
421
|
-
command.
|
422
|
-
command.
|
423
|
-
command.
|
470
|
+
def setup_space(set_up_space_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
471
|
+
command = make_simple_command(:post, 'v1/spaces:setup', options)
|
472
|
+
command.request_representation = Google::Apis::ChatV1::SetUpSpaceRequest::Representation
|
473
|
+
command.request_object = set_up_space_request_object
|
474
|
+
command.response_representation = Google::Apis::ChatV1::Space::Representation
|
475
|
+
command.response_class = Google::Apis::ChatV1::Space
|
424
476
|
command.query['fields'] = fields unless fields.nil?
|
425
477
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
426
478
|
execute_or_queue_command(command, &block)
|
427
479
|
end
|
428
480
|
|
429
|
-
#
|
430
|
-
#
|
481
|
+
# Creates a human membership or app membership for the calling app. Creating
|
482
|
+
# memberships for other apps isn't supported. For an example, see [ Create a
|
483
|
+
# membership](https://developers.google.com/chat/api/guides/v1/members/create).
|
484
|
+
# When creating a membership, if the specified member has their auto-accept
|
485
|
+
# policy turned off, then they're invited, and must accept the space invitation
|
486
|
+
# before joining. Otherwise, creating a membership adds the member directly to
|
487
|
+
# the specified space. Requires [user authentication](https://developers.google.
|
488
|
+
# com/chat/api/guides/auth/users). To specify the member to add, set the `
|
489
|
+
# membership.member.name` in the `CreateMembershipRequest`: - To add the calling
|
490
|
+
# app to a space or a direct message between two human users, use `users/app`.
|
491
|
+
# Unable to add other apps to the space. - To add a human user, use `users/`user`
|
492
|
+
# `, where ``user`` can be the email address for the user. For users in the same
|
493
|
+
# Workspace organization ``user`` can also be the ``person_id`` for the person
|
494
|
+
# from the People API, or the `id` for the user in the Directory API. For
|
495
|
+
# example, if the People API Person `resourceName` for `user@example.com` is `
|
496
|
+
# people/123456789`, you can add the user to the space by setting the `
|
497
|
+
# membership.member.name` to `users/user@example.com` or `users/123456789`.
|
431
498
|
# @param [String] parent
|
432
|
-
# Required.
|
433
|
-
#
|
434
|
-
# @param [Google::Apis::ChatV1::
|
435
|
-
# @param [String] request_id
|
436
|
-
# Optional. A unique request ID for this message. Specifying an existing request
|
437
|
-
# ID returns the message created with that ID instead of creating a new message.
|
438
|
-
# @param [String] thread_key
|
439
|
-
# Optional. Opaque thread identifier. To start or add to a thread, create a
|
440
|
-
# message and specify a `threadKey` instead of thread.name. (Setting thread.name
|
441
|
-
# has no effect.) The first message with a given `threadKey` starts a new thread.
|
442
|
-
# Subsequent messages with the same `threadKey` post into the same thread.
|
499
|
+
# Required. The resource name of the space for which to create the membership.
|
500
|
+
# Format: spaces/`space`
|
501
|
+
# @param [Google::Apis::ChatV1::Membership] membership_object
|
443
502
|
# @param [String] fields
|
444
503
|
# Selector specifying which fields to include in a partial response.
|
445
504
|
# @param [String] quota_user
|
@@ -449,33 +508,81 @@ module Google
|
|
449
508
|
# Request-specific options
|
450
509
|
#
|
451
510
|
# @yield [result, err] Result & error if block supplied
|
452
|
-
# @yieldparam result [Google::Apis::ChatV1::
|
511
|
+
# @yieldparam result [Google::Apis::ChatV1::Membership] parsed result object
|
453
512
|
# @yieldparam err [StandardError] error object if request failed
|
454
513
|
#
|
455
|
-
# @return [Google::Apis::ChatV1::
|
514
|
+
# @return [Google::Apis::ChatV1::Membership]
|
456
515
|
#
|
457
516
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
458
517
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
459
518
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
460
|
-
def
|
461
|
-
command = make_simple_command(:post, 'v1/{+parent}/
|
462
|
-
command.request_representation = Google::Apis::ChatV1::
|
463
|
-
command.request_object =
|
464
|
-
command.response_representation = Google::Apis::ChatV1::
|
465
|
-
command.response_class = Google::Apis::ChatV1::
|
519
|
+
def create_space_member(parent, membership_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
520
|
+
command = make_simple_command(:post, 'v1/{+parent}/members', options)
|
521
|
+
command.request_representation = Google::Apis::ChatV1::Membership::Representation
|
522
|
+
command.request_object = membership_object
|
523
|
+
command.response_representation = Google::Apis::ChatV1::Membership::Representation
|
524
|
+
command.response_class = Google::Apis::ChatV1::Membership
|
466
525
|
command.params['parent'] = parent unless parent.nil?
|
467
|
-
command.query['requestId'] = request_id unless request_id.nil?
|
468
|
-
command.query['threadKey'] = thread_key unless thread_key.nil?
|
469
526
|
command.query['fields'] = fields unless fields.nil?
|
470
527
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
471
528
|
execute_or_queue_command(command, &block)
|
472
529
|
end
|
473
530
|
|
474
|
-
#
|
475
|
-
# developers.google.com/chat/api/guides/
|
531
|
+
# Deletes a membership. For an example, see [Delete a membership](https://
|
532
|
+
# developers.google.com/chat/api/guides/v1/members/delete). Requires [user
|
533
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users).
|
476
534
|
# @param [String] name
|
477
|
-
# Required. Resource name of the membership to
|
478
|
-
#
|
535
|
+
# Required. Resource name of the membership to delete. Chat apps can delete
|
536
|
+
# human users' or their own memberships. Chat apps can't delete other apps'
|
537
|
+
# memberships. When deleting a human membership, requires the `chat.memberships`
|
538
|
+
# scope and `spaces/`space`/members/`member`` format. You can use the email as
|
539
|
+
# an alias for ``member``. For example, `spaces/`space`/members/example@gmail.
|
540
|
+
# com` where `example@gmail.com` is the email of the Google Chat user. When
|
541
|
+
# deleting an app membership, requires the `chat.memberships.app` scope and `
|
542
|
+
# spaces/`space`/members/app` format. Format: `spaces/`space`/members/`member``
|
543
|
+
# or `spaces/`space`/members/app`.
|
544
|
+
# @param [String] fields
|
545
|
+
# Selector specifying which fields to include in a partial response.
|
546
|
+
# @param [String] quota_user
|
547
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
548
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
549
|
+
# @param [Google::Apis::RequestOptions] options
|
550
|
+
# Request-specific options
|
551
|
+
#
|
552
|
+
# @yield [result, err] Result & error if block supplied
|
553
|
+
# @yieldparam result [Google::Apis::ChatV1::Membership] parsed result object
|
554
|
+
# @yieldparam err [StandardError] error object if request failed
|
555
|
+
#
|
556
|
+
# @return [Google::Apis::ChatV1::Membership]
|
557
|
+
#
|
558
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
559
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
560
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
561
|
+
def delete_space_member(name, fields: nil, quota_user: nil, options: nil, &block)
|
562
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
563
|
+
command.response_representation = Google::Apis::ChatV1::Membership::Representation
|
564
|
+
command.response_class = Google::Apis::ChatV1::Membership
|
565
|
+
command.params['name'] = name unless name.nil?
|
566
|
+
command.query['fields'] = fields unless fields.nil?
|
567
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
568
|
+
execute_or_queue_command(command, &block)
|
569
|
+
end
|
570
|
+
|
571
|
+
# Returns details about a membership. For an example, see [Get a membership](
|
572
|
+
# https://developers.google.com/chat/api/guides/v1/members/get). Requires [
|
573
|
+
# authentication](https://developers.google.com/chat/api/guides/auth). Fully
|
574
|
+
# supports [service account authentication](https://developers.google.com/chat/
|
575
|
+
# api/guides/auth/service-accounts) and [user authentication](https://developers.
|
576
|
+
# google.com/chat/api/guides/auth/users). [User authentication](https://
|
577
|
+
# developers.google.com/chat/api/guides/auth/users).
|
578
|
+
# @param [String] name
|
579
|
+
# Required. Resource name of the membership to retrieve. To get the app's own
|
580
|
+
# membership, you can optionally use `spaces/`space`/members/app`. Format: `
|
581
|
+
# spaces/`space`/members/`member`` or `spaces/`space`/members/app` When [
|
582
|
+
# authenticated as a user](https://developers.google.com/chat/api/guides/auth/
|
583
|
+
# users), you can use the user's email as an alias for ``member``. For example, `
|
584
|
+
# spaces/`space`/members/example@gmail.com` where `example@gmail.com` is the
|
585
|
+
# email of the Google Chat user.
|
479
586
|
# @param [String] fields
|
480
587
|
# Selector specifying which fields to include in a partial response.
|
481
588
|
# @param [String] quota_user
|
@@ -503,16 +610,52 @@ module Google
|
|
503
610
|
execute_or_queue_command(command, &block)
|
504
611
|
end
|
505
612
|
|
506
|
-
# Lists
|
507
|
-
#
|
613
|
+
# Lists memberships in a space. For an example, see [List memberships](https://
|
614
|
+
# developers.google.com/chat/api/guides/v1/members/list). Listing memberships
|
615
|
+
# with [app authentication](https://developers.google.com/chat/api/guides/auth/
|
616
|
+
# service-accounts) lists memberships in spaces that the Chat app has access to,
|
617
|
+
# but excludes Chat app memberships, including its own. Listing memberships with
|
618
|
+
# [User authentication](https://developers.google.com/chat/api/guides/auth/users)
|
619
|
+
# lists memberships in spaces that the authenticated user has access to.
|
620
|
+
# Requires [authentication](https://developers.google.com/chat/api/guides/auth).
|
621
|
+
# Fully supports [service account authentication](https://developers.google.com/
|
622
|
+
# chat/api/guides/auth/service-accounts) and [user authentication](https://
|
623
|
+
# developers.google.com/chat/api/guides/auth/users). [User authentication](https:
|
624
|
+
# //developers.google.com/chat/api/guides/auth/users).
|
508
625
|
# @param [String] parent
|
509
626
|
# Required. The resource name of the space for which to fetch a membership list.
|
510
627
|
# Format: spaces/`space`
|
628
|
+
# @param [String] filter
|
629
|
+
# Optional. A query filter. You can filter memberships by a member's role ([`
|
630
|
+
# role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#
|
631
|
+
# membershiprole)) and type ([`member.type`](https://developers.google.com/chat/
|
632
|
+
# api/reference/rest/v1/User#type)). To filter by role, set `role` to `
|
633
|
+
# ROLE_MEMBER` or `ROLE_MANAGER`. To filter by type, set `member.type` to `HUMAN`
|
634
|
+
# or `BOT`. To filter by both role and type, use the `AND` operator. To filter
|
635
|
+
# by either role or type, use the `OR` operator. For example, the following
|
636
|
+
# queries are valid: ``` role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" member.
|
637
|
+
# type = "HUMAN" AND role = "ROLE_MANAGER" ``` The following queries are invalid:
|
638
|
+
# ``` member.type = "HUMAN" AND member.type = "BOT" role = "ROLE_MANAGER" AND
|
639
|
+
# role = "ROLE_MEMBER" ``` Invalid queries are rejected by the server with an `
|
640
|
+
# INVALID_ARGUMENT` error.
|
511
641
|
# @param [Fixnum] page_size
|
512
|
-
#
|
513
|
-
#
|
642
|
+
# Optional. The maximum number of memberships to return. The service might
|
643
|
+
# return fewer than this value. If unspecified, at most 100 memberships are
|
644
|
+
# returned. The maximum value is 1,000. If you use a value more than 1,000, it's
|
645
|
+
# automatically changed to 1,000. Negative values return an `INVALID_ARGUMENT`
|
646
|
+
# error.
|
514
647
|
# @param [String] page_token
|
515
|
-
# A token
|
648
|
+
# Optional. A page token, received from a previous call to list memberships.
|
649
|
+
# Provide this parameter to retrieve the subsequent page. When paginating, all
|
650
|
+
# other parameters provided should match the call that provided the page token.
|
651
|
+
# Passing different values to the other parameters might lead to unexpected
|
652
|
+
# results.
|
653
|
+
# @param [Boolean] show_invited
|
654
|
+
# Optional. When `true`, also returns memberships associated with invited
|
655
|
+
# members, in addition to other types of memberships. If a filter is set,
|
656
|
+
# invited memberships that don't match the filter criteria aren't returned.
|
657
|
+
# Currently requires [user authentication](https://developers.google.com/chat/
|
658
|
+
# api/guides/auth/users).
|
516
659
|
# @param [String] fields
|
517
660
|
# Selector specifying which fields to include in a partial response.
|
518
661
|
# @param [String] quota_user
|
@@ -530,32 +673,56 @@ module Google
|
|
530
673
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
531
674
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
532
675
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
533
|
-
def list_space_members(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
676
|
+
def list_space_members(parent, filter: nil, page_size: nil, page_token: nil, show_invited: nil, fields: nil, quota_user: nil, options: nil, &block)
|
534
677
|
command = make_simple_command(:get, 'v1/{+parent}/members', options)
|
535
678
|
command.response_representation = Google::Apis::ChatV1::ListMembershipsResponse::Representation
|
536
679
|
command.response_class = Google::Apis::ChatV1::ListMembershipsResponse
|
537
680
|
command.params['parent'] = parent unless parent.nil?
|
681
|
+
command.query['filter'] = filter unless filter.nil?
|
538
682
|
command.query['pageSize'] = page_size unless page_size.nil?
|
539
683
|
command.query['pageToken'] = page_token unless page_token.nil?
|
684
|
+
command.query['showInvited'] = show_invited unless show_invited.nil?
|
540
685
|
command.query['fields'] = fields unless fields.nil?
|
541
686
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
542
687
|
execute_or_queue_command(command, &block)
|
543
688
|
end
|
544
689
|
|
545
|
-
# Creates a message.
|
546
|
-
# developers.google.com/chat/api/guides/
|
690
|
+
# Creates a message in a Google Chat space. For an example, see [Create a
|
691
|
+
# message](https://developers.google.com/chat/api/guides/v1/messages/create).
|
692
|
+
# Calling this method requires [authentication](https://developers.google.com/
|
693
|
+
# chat/api/guides/auth) and supports the following authentication types: - For
|
694
|
+
# text messages, user authentication or app authentication are supported. - For
|
695
|
+
# card messages, only app authentication is supported. (Only Chat apps can
|
696
|
+
# create card messages.)
|
547
697
|
# @param [String] parent
|
548
|
-
# Required.
|
549
|
-
#
|
698
|
+
# Required. The resource name of the space in which to create a message. Format:
|
699
|
+
# `spaces/`space``
|
550
700
|
# @param [Google::Apis::ChatV1::Message] message_object
|
701
|
+
# @param [String] message_id
|
702
|
+
# Optional. A custom name for a Chat message assigned at creation. Must start
|
703
|
+
# with `client-` and contain only lowercase letters, numbers, and hyphens up to
|
704
|
+
# 63 characters in length. Specify this field to get, update, or delete the
|
705
|
+
# message with the specified value. Assigning a custom name lets a a Chat app
|
706
|
+
# recall the message without saving the message `name` from the [response body](/
|
707
|
+
# chat/api/reference/rest/v1/spaces.messages/get#response-body) returned when
|
708
|
+
# creating the message. Assigning a custom name doesn't replace the generated `
|
709
|
+
# name` field, the message's resource name. Instead, it sets the custom name as
|
710
|
+
# the `clientAssignedMessageId` field, which you can reference while processing
|
711
|
+
# later operations, like updating or deleting the message. For example usage,
|
712
|
+
# see [Name a created message](https://developers.google.com/chat/api/guides/v1/
|
713
|
+
# messages/create#name_a_created_message).
|
714
|
+
# @param [String] message_reply_option
|
715
|
+
# Optional. Specifies whether a message starts a thread or replies to one. Only
|
716
|
+
# supported in named spaces.
|
551
717
|
# @param [String] request_id
|
552
718
|
# Optional. A unique request ID for this message. Specifying an existing request
|
553
719
|
# ID returns the message created with that ID instead of creating a new message.
|
554
720
|
# @param [String] thread_key
|
555
|
-
# Optional.
|
556
|
-
#
|
557
|
-
#
|
558
|
-
#
|
721
|
+
# Optional. Deprecated: Use thread.thread_key instead. ID for the thread.
|
722
|
+
# Supports up to 4000 characters. To start or add to a thread, create a message
|
723
|
+
# and specify a `threadKey` or the thread.name. For example usage, see [Start or
|
724
|
+
# reply to a message thread](https://developers.google.com/chat/api/guides/crudl/
|
725
|
+
# messages#start_or_reply_to_a_message_thread).
|
559
726
|
# @param [String] fields
|
560
727
|
# Selector specifying which fields to include in a partial response.
|
561
728
|
# @param [String] quota_user
|
@@ -573,13 +740,15 @@ module Google
|
|
573
740
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
574
741
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
575
742
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
576
|
-
def create_space_message(parent, message_object = nil, request_id: nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
|
743
|
+
def create_space_message(parent, message_object = nil, message_id: nil, message_reply_option: nil, request_id: nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
|
577
744
|
command = make_simple_command(:post, 'v1/{+parent}/messages', options)
|
578
745
|
command.request_representation = Google::Apis::ChatV1::Message::Representation
|
579
746
|
command.request_object = message_object
|
580
747
|
command.response_representation = Google::Apis::ChatV1::Message::Representation
|
581
748
|
command.response_class = Google::Apis::ChatV1::Message
|
582
749
|
command.params['parent'] = parent unless parent.nil?
|
750
|
+
command.query['messageId'] = message_id unless message_id.nil?
|
751
|
+
command.query['messageReplyOption'] = message_reply_option unless message_reply_option.nil?
|
583
752
|
command.query['requestId'] = request_id unless request_id.nil?
|
584
753
|
command.query['threadKey'] = thread_key unless thread_key.nil?
|
585
754
|
command.query['fields'] = fields unless fields.nil?
|
@@ -587,11 +756,24 @@ module Google
|
|
587
756
|
execute_or_queue_command(command, &block)
|
588
757
|
end
|
589
758
|
|
590
|
-
# Deletes a message.
|
591
|
-
#
|
759
|
+
# Deletes a message. For an example, see [Delete a message](https://developers.
|
760
|
+
# google.com/chat/api/guides/v1/messages/delete). Requires [authentication](
|
761
|
+
# https://developers.google.com/chat/api/guides/auth). Fully supports [service
|
762
|
+
# account authentication](https://developers.google.com/chat/api/guides/auth/
|
763
|
+
# service-accounts) and [user authentication](https://developers.google.com/chat/
|
764
|
+
# api/guides/auth/users). [User authentication](https://developers.google.com/
|
765
|
+
# chat/api/guides/auth/users). Requests authenticated with service accounts can
|
766
|
+
# only delete messages created by the calling Chat app.
|
592
767
|
# @param [String] name
|
593
|
-
# Required. Resource name of the message to
|
594
|
-
# messages
|
768
|
+
# Required. Resource name of the message that you want to delete, in the form `
|
769
|
+
# spaces/*/messages/*` Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.
|
770
|
+
# BBBBBBBBBBB`
|
771
|
+
# @param [Boolean] force
|
772
|
+
# When `true`, deleting a message also deletes its threaded replies. When `false`
|
773
|
+
# , if a message has threaded replies, deletion fails. Only applies when [
|
774
|
+
# authenticating as a user](https://developers.google.com/chat/api/guides/auth/
|
775
|
+
# users). Has no effect when [authenticating with a service account] (https://
|
776
|
+
# developers.google.com/chat/api/guides/auth/service-accounts).
|
595
777
|
# @param [String] fields
|
596
778
|
# Selector specifying which fields to include in a partial response.
|
597
779
|
# @param [String] quota_user
|
@@ -609,21 +791,32 @@ module Google
|
|
609
791
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
610
792
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
611
793
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
612
|
-
def delete_space_message(name, fields: nil, quota_user: nil, options: nil, &block)
|
794
|
+
def delete_space_message(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
|
613
795
|
command = make_simple_command(:delete, 'v1/{+name}', options)
|
614
796
|
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
615
797
|
command.response_class = Google::Apis::ChatV1::Empty
|
616
798
|
command.params['name'] = name unless name.nil?
|
799
|
+
command.query['force'] = force unless force.nil?
|
617
800
|
command.query['fields'] = fields unless fields.nil?
|
618
801
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
619
802
|
execute_or_queue_command(command, &block)
|
620
803
|
end
|
621
804
|
|
622
|
-
# Returns a message.
|
623
|
-
# developers.google.com/chat/api/guides/
|
805
|
+
# Returns details about a message. For an example, see [Read a message](https://
|
806
|
+
# developers.google.com/chat/api/guides/v1/messages/get). Requires [
|
807
|
+
# authentication](https://developers.google.com/chat/api/guides/auth). Fully
|
808
|
+
# supports [service account authentication](https://developers.google.com/chat/
|
809
|
+
# api/guides/auth/service-accounts) and [user authentication](https://developers.
|
810
|
+
# google.com/chat/api/guides/auth/users). [User authentication](https://
|
811
|
+
# developers.google.com/chat/api/guides/auth/users). Note: Might return a
|
812
|
+
# message from a blocked member or space.
|
624
813
|
# @param [String] name
|
625
|
-
# Required. Resource name of the message to
|
626
|
-
# messages
|
814
|
+
# Required. Resource name of the message to retrieve. Format: `spaces/`space`/
|
815
|
+
# messages/`message`` If the message begins with `client-`, then it has a custom
|
816
|
+
# name assigned by a Chat app that created it with the Chat REST API. That Chat
|
817
|
+
# app (but not others) can pass the custom name to get, update, or delete the
|
818
|
+
# message. To learn more, see [create and name a message] (https://developers.
|
819
|
+
# google.com/chat/api/guides/v1/messages/create#name_a_created_message).
|
627
820
|
# @param [String] fields
|
628
821
|
# Selector specifying which fields to include in a partial response.
|
629
822
|
# @param [String] quota_user
|
@@ -651,16 +844,108 @@ module Google
|
|
651
844
|
execute_or_queue_command(command, &block)
|
652
845
|
end
|
653
846
|
|
654
|
-
#
|
655
|
-
#
|
847
|
+
# Lists messages in a space that the caller is a member of, including messages
|
848
|
+
# from blocked members and spaces. For an example, see [List messages](/chat/api/
|
849
|
+
# guides/v1/messages/list). Requires [user authentication](https://developers.
|
850
|
+
# google.com/chat/api/guides/auth/users).
|
851
|
+
# @param [String] parent
|
852
|
+
# Required. The resource name of the space to list messages from. Format: `
|
853
|
+
# spaces/`space``
|
854
|
+
# @param [String] filter
|
855
|
+
# A query filter. You can filter messages by date (`create_time`) and thread (`
|
856
|
+
# thread.name`). To filter messages by the date they were created, specify the `
|
857
|
+
# create_time` with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/
|
858
|
+
# rfc3339) format and double quotation marks. For example, `"2023-04-21T11:30:00-
|
859
|
+
# 04:00"`. You can use the greater than operator `>` to list messages that were
|
860
|
+
# created after a timestamp, or the less than operator `<` to list messages that
|
861
|
+
# were created before a timestamp. To filter messages within a time interval,
|
862
|
+
# use the `AND` operator between two timestamps. To filter by thread, specify
|
863
|
+
# the `thread.name`, formatted as `spaces/`space`/threads/`thread``. You can
|
864
|
+
# only specify one `thread.name` per query. To filter by both thread and date,
|
865
|
+
# use the `AND` operator in your query. For example, the following queries are
|
866
|
+
# valid: ``` create_time > "2012-04-21T11:30:00-04:00" create_time > "2012-04-
|
867
|
+
# 21T11:30:00-04:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123
|
868
|
+
# create_time > "2012-04-21T11:30:00+00:00" AND create_time < "2013-01-01T00:00:
|
869
|
+
# 00+00:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123 thread.name =
|
870
|
+
# spaces/AAAAAAAAAAA/threads/123 ``` Invalid queries are rejected by the server
|
871
|
+
# with an `INVALID_ARGUMENT` error.
|
872
|
+
# @param [String] order_by
|
873
|
+
# Optional, if resuming from a previous query. How the list of messages is
|
874
|
+
# ordered. Specify a value to order by an ordering operation. Valid ordering
|
875
|
+
# operation values are as follows: - `ASC` for ascending. - `DESC` for
|
876
|
+
# descending. The default ordering is `create_time ASC`.
|
877
|
+
# @param [Fixnum] page_size
|
878
|
+
# The maximum number of messages returned. The service might return fewer
|
879
|
+
# messages than this value. If unspecified, at most 25 are returned. The maximum
|
880
|
+
# value is 1,000. If you use a value more than 1,000, it's automatically changed
|
881
|
+
# to 1,000. Negative values return an `INVALID_ARGUMENT` error.
|
882
|
+
# @param [String] page_token
|
883
|
+
# Optional, if resuming from a previous query. A page token received from a
|
884
|
+
# previous list messages call. Provide this parameter to retrieve the subsequent
|
885
|
+
# page. When paginating, all other parameters provided should match the call
|
886
|
+
# that provided the page token. Passing different values to the other parameters
|
887
|
+
# might lead to unexpected results.
|
888
|
+
# @param [Boolean] show_deleted
|
889
|
+
# Whether to include deleted messages. Deleted messages include deleted time and
|
890
|
+
# metadata about their deletion, but message content is unavailable.
|
891
|
+
# @param [String] fields
|
892
|
+
# Selector specifying which fields to include in a partial response.
|
893
|
+
# @param [String] quota_user
|
894
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
895
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
896
|
+
# @param [Google::Apis::RequestOptions] options
|
897
|
+
# Request-specific options
|
898
|
+
#
|
899
|
+
# @yield [result, err] Result & error if block supplied
|
900
|
+
# @yieldparam result [Google::Apis::ChatV1::ListMessagesResponse] parsed result object
|
901
|
+
# @yieldparam err [StandardError] error object if request failed
|
902
|
+
#
|
903
|
+
# @return [Google::Apis::ChatV1::ListMessagesResponse]
|
904
|
+
#
|
905
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
906
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
907
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
908
|
+
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)
|
909
|
+
command = make_simple_command(:get, 'v1/{+parent}/messages', options)
|
910
|
+
command.response_representation = Google::Apis::ChatV1::ListMessagesResponse::Representation
|
911
|
+
command.response_class = Google::Apis::ChatV1::ListMessagesResponse
|
912
|
+
command.params['parent'] = parent unless parent.nil?
|
913
|
+
command.query['filter'] = filter unless filter.nil?
|
914
|
+
command.query['orderBy'] = order_by unless order_by.nil?
|
915
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
916
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
917
|
+
command.query['showDeleted'] = show_deleted unless show_deleted.nil?
|
918
|
+
command.query['fields'] = fields unless fields.nil?
|
919
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
920
|
+
execute_or_queue_command(command, &block)
|
921
|
+
end
|
922
|
+
|
923
|
+
# Updates a message. There's a difference between the `patch` and `update`
|
924
|
+
# methods. The `patch` method uses a `patch` request while the `update` method
|
925
|
+
# uses a `put` request. We recommend using the `patch` method. For an example,
|
926
|
+
# see [Update a message](https://developers.google.com/chat/api/guides/v1/
|
927
|
+
# messages/update). Requires [authentication](https://developers.google.com/chat/
|
928
|
+
# api/guides/auth). Fully supports [service account authentication](https://
|
929
|
+
# developers.google.com/chat/api/guides/auth/service-accounts) and [user
|
930
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users). [
|
931
|
+
# User authentication](https://developers.google.com/chat/api/guides/auth/users).
|
932
|
+
# Requests authenticated with service accounts can only update messages created
|
933
|
+
# by the calling Chat app.
|
656
934
|
# @param [String] name
|
657
935
|
# Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/
|
658
936
|
# messages/BBBBBBBBBBB.BBBBBBBBBBB`
|
659
937
|
# @param [Google::Apis::ChatV1::Message] message_object
|
938
|
+
# @param [Boolean] allow_missing
|
939
|
+
# Optional. If `true` and the message isn't found, a new message is created and `
|
940
|
+
# updateMask` is ignored. The specified message ID must be [client-assigned](
|
941
|
+
# https://developers.google.com/chat/api/guides/v1/messages/create#
|
942
|
+
# name_a_created_message) or the request fails.
|
660
943
|
# @param [String] update_mask
|
661
944
|
# Required. The field paths to update. Separate multiple values with commas.
|
662
|
-
# Currently supported field paths: - text - cards (Requires [
|
663
|
-
# authentication](/chat/api/guides/auth/service-accounts).) -
|
945
|
+
# Currently supported field paths: - `text` - `attachment` - `cards` (Requires [
|
946
|
+
# service account authentication](/chat/api/guides/auth/service-accounts).) - `
|
947
|
+
# cards_v2` (Requires [service account authentication](/chat/api/guides/auth/
|
948
|
+
# service-accounts).)
|
664
949
|
# @param [String] fields
|
665
950
|
# Selector specifying which fields to include in a partial response.
|
666
951
|
# @param [String] quota_user
|
@@ -678,13 +963,71 @@ module Google
|
|
678
963
|
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
679
964
|
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
680
965
|
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
681
|
-
def
|
966
|
+
def patch_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
967
|
+
command = make_simple_command(:patch, 'v1/{+name}', options)
|
968
|
+
command.request_representation = Google::Apis::ChatV1::Message::Representation
|
969
|
+
command.request_object = message_object
|
970
|
+
command.response_representation = Google::Apis::ChatV1::Message::Representation
|
971
|
+
command.response_class = Google::Apis::ChatV1::Message
|
972
|
+
command.params['name'] = name unless name.nil?
|
973
|
+
command.query['allowMissing'] = allow_missing unless allow_missing.nil?
|
974
|
+
command.query['updateMask'] = update_mask unless update_mask.nil?
|
975
|
+
command.query['fields'] = fields unless fields.nil?
|
976
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
977
|
+
execute_or_queue_command(command, &block)
|
978
|
+
end
|
979
|
+
|
980
|
+
# Updates a message. There's a difference between the `patch` and `update`
|
981
|
+
# methods. The `patch` method uses a `patch` request while the `update` method
|
982
|
+
# uses a `put` request. We recommend using the `patch` method. For an example,
|
983
|
+
# see [Update a message](https://developers.google.com/chat/api/guides/v1/
|
984
|
+
# messages/update). Requires [authentication](https://developers.google.com/chat/
|
985
|
+
# api/guides/auth). Fully supports [service account authentication](https://
|
986
|
+
# developers.google.com/chat/api/guides/auth/service-accounts) and [user
|
987
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users). [
|
988
|
+
# User authentication](https://developers.google.com/chat/api/guides/auth/users).
|
989
|
+
# Requests authenticated with service accounts can only update messages created
|
990
|
+
# by the calling Chat app.
|
991
|
+
# @param [String] name
|
992
|
+
# Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/
|
993
|
+
# messages/BBBBBBBBBBB.BBBBBBBBBBB`
|
994
|
+
# @param [Google::Apis::ChatV1::Message] message_object
|
995
|
+
# @param [Boolean] allow_missing
|
996
|
+
# Optional. If `true` and the message isn't found, a new message is created and `
|
997
|
+
# updateMask` is ignored. The specified message ID must be [client-assigned](
|
998
|
+
# https://developers.google.com/chat/api/guides/v1/messages/create#
|
999
|
+
# name_a_created_message) or the request fails.
|
1000
|
+
# @param [String] update_mask
|
1001
|
+
# Required. The field paths to update. Separate multiple values with commas.
|
1002
|
+
# Currently supported field paths: - `text` - `attachment` - `cards` (Requires [
|
1003
|
+
# service account authentication](/chat/api/guides/auth/service-accounts).) - `
|
1004
|
+
# cards_v2` (Requires [service account authentication](/chat/api/guides/auth/
|
1005
|
+
# service-accounts).)
|
1006
|
+
# @param [String] fields
|
1007
|
+
# Selector specifying which fields to include in a partial response.
|
1008
|
+
# @param [String] quota_user
|
1009
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1010
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1011
|
+
# @param [Google::Apis::RequestOptions] options
|
1012
|
+
# Request-specific options
|
1013
|
+
#
|
1014
|
+
# @yield [result, err] Result & error if block supplied
|
1015
|
+
# @yieldparam result [Google::Apis::ChatV1::Message] parsed result object
|
1016
|
+
# @yieldparam err [StandardError] error object if request failed
|
1017
|
+
#
|
1018
|
+
# @return [Google::Apis::ChatV1::Message]
|
1019
|
+
#
|
1020
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1021
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1022
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1023
|
+
def update_space_message(name, message_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
682
1024
|
command = make_simple_command(:put, 'v1/{+name}', options)
|
683
1025
|
command.request_representation = Google::Apis::ChatV1::Message::Representation
|
684
1026
|
command.request_object = message_object
|
685
1027
|
command.response_representation = Google::Apis::ChatV1::Message::Representation
|
686
1028
|
command.response_class = Google::Apis::ChatV1::Message
|
687
1029
|
command.params['name'] = name unless name.nil?
|
1030
|
+
command.query['allowMissing'] = allow_missing unless allow_missing.nil?
|
688
1031
|
command.query['updateMask'] = update_mask unless update_mask.nil?
|
689
1032
|
command.query['fields'] = fields unless fields.nil?
|
690
1033
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
@@ -692,11 +1035,14 @@ module Google
|
|
692
1035
|
end
|
693
1036
|
|
694
1037
|
# Gets the metadata of a message attachment. The attachment data is fetched
|
695
|
-
# using the media API
|
696
|
-
#
|
1038
|
+
# using the [media API](https://developers.google.com/chat/api/reference/rest/v1/
|
1039
|
+
# media/download). For an example, see [Get a message attachment](https://
|
1040
|
+
# developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [
|
1041
|
+
# service account authentication](https://developers.google.com/chat/api/guides/
|
1042
|
+
# auth/service-accounts).
|
697
1043
|
# @param [String] name
|
698
|
-
# Required. Resource name of the attachment, in the form
|
699
|
-
# attachments
|
1044
|
+
# Required. Resource name of the attachment, in the form `spaces/*/messages/*/
|
1045
|
+
# attachments/*`.
|
700
1046
|
# @param [String] fields
|
701
1047
|
# Selector specifying which fields to include in a partial response.
|
702
1048
|
# @param [String] quota_user
|
@@ -723,6 +1069,142 @@ module Google
|
|
723
1069
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
724
1070
|
execute_or_queue_command(command, &block)
|
725
1071
|
end
|
1072
|
+
|
1073
|
+
# Creates a reaction and adds it to a message. For an example, see [Create a
|
1074
|
+
# reaction](https://developers.google.com/chat/api/guides/v1/reactions/create).
|
1075
|
+
# Requires [user authentication](https://developers.google.com/chat/api/guides/
|
1076
|
+
# auth/users). Only unicode emoji are supported.
|
1077
|
+
# @param [String] parent
|
1078
|
+
# Required. The message where the reaction is created. Format: `spaces/`space`/
|
1079
|
+
# messages/`message``
|
1080
|
+
# @param [Google::Apis::ChatV1::Reaction] reaction_object
|
1081
|
+
# @param [String] fields
|
1082
|
+
# Selector specifying which fields to include in a partial response.
|
1083
|
+
# @param [String] quota_user
|
1084
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1085
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1086
|
+
# @param [Google::Apis::RequestOptions] options
|
1087
|
+
# Request-specific options
|
1088
|
+
#
|
1089
|
+
# @yield [result, err] Result & error if block supplied
|
1090
|
+
# @yieldparam result [Google::Apis::ChatV1::Reaction] parsed result object
|
1091
|
+
# @yieldparam err [StandardError] error object if request failed
|
1092
|
+
#
|
1093
|
+
# @return [Google::Apis::ChatV1::Reaction]
|
1094
|
+
#
|
1095
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1096
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1097
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1098
|
+
def create_space_message_reaction(parent, reaction_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
1099
|
+
command = make_simple_command(:post, 'v1/{+parent}/reactions', options)
|
1100
|
+
command.request_representation = Google::Apis::ChatV1::Reaction::Representation
|
1101
|
+
command.request_object = reaction_object
|
1102
|
+
command.response_representation = Google::Apis::ChatV1::Reaction::Representation
|
1103
|
+
command.response_class = Google::Apis::ChatV1::Reaction
|
1104
|
+
command.params['parent'] = parent unless parent.nil?
|
1105
|
+
command.query['fields'] = fields unless fields.nil?
|
1106
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1107
|
+
execute_or_queue_command(command, &block)
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
# Deletes a reaction to a message. For an example, see [Delete a reaction](https:
|
1111
|
+
# //developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user
|
1112
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users).
|
1113
|
+
# @param [String] name
|
1114
|
+
# Required. Name of the reaction to delete. Format: `spaces/`space`/messages/`
|
1115
|
+
# message`/reactions/`reaction``
|
1116
|
+
# @param [String] fields
|
1117
|
+
# Selector specifying which fields to include in a partial response.
|
1118
|
+
# @param [String] quota_user
|
1119
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1120
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1121
|
+
# @param [Google::Apis::RequestOptions] options
|
1122
|
+
# Request-specific options
|
1123
|
+
#
|
1124
|
+
# @yield [result, err] Result & error if block supplied
|
1125
|
+
# @yieldparam result [Google::Apis::ChatV1::Empty] parsed result object
|
1126
|
+
# @yieldparam err [StandardError] error object if request failed
|
1127
|
+
#
|
1128
|
+
# @return [Google::Apis::ChatV1::Empty]
|
1129
|
+
#
|
1130
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1131
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1132
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1133
|
+
def delete_space_message_reaction(name, fields: nil, quota_user: nil, options: nil, &block)
|
1134
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
1135
|
+
command.response_representation = Google::Apis::ChatV1::Empty::Representation
|
1136
|
+
command.response_class = Google::Apis::ChatV1::Empty
|
1137
|
+
command.params['name'] = name unless name.nil?
|
1138
|
+
command.query['fields'] = fields unless fields.nil?
|
1139
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1140
|
+
execute_or_queue_command(command, &block)
|
1141
|
+
end
|
1142
|
+
|
1143
|
+
# Lists reactions to a message. For an example, see [List reactions](https://
|
1144
|
+
# developers.google.com/chat/api/guides/v1/reactions/list). Requires [user
|
1145
|
+
# authentication](https://developers.google.com/chat/api/guides/auth/users).
|
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
|
726
1208
|
|
727
1209
|
protected
|
728
1210
|
|