google-apps-chat-v1 0.a → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/apps/chat/v1/chat_service/client.rb +3673 -0
  6. data/lib/google/apps/chat/v1/chat_service/credentials.rb +63 -0
  7. data/lib/google/apps/chat/v1/chat_service/paths.rb +191 -0
  8. data/lib/google/apps/chat/v1/chat_service/rest/client.rb +3497 -0
  9. data/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb +1614 -0
  10. data/lib/google/apps/chat/v1/chat_service/rest.rb +53 -0
  11. data/lib/google/apps/chat/v1/chat_service.rb +56 -0
  12. data/lib/google/apps/chat/v1/rest.rb +37 -0
  13. data/lib/google/apps/chat/v1/version.rb +7 -2
  14. data/lib/google/apps/chat/v1.rb +45 -0
  15. data/lib/google/chat/v1/action_status_pb.rb +44 -0
  16. data/lib/google/chat/v1/annotation_pb.rb +56 -0
  17. data/lib/google/chat/v1/attachment_pb.rb +51 -0
  18. data/lib/google/chat/v1/chat_service_pb.rb +53 -0
  19. data/lib/google/chat/v1/chat_service_services_pb.rb +369 -0
  20. data/lib/google/chat/v1/contextual_addon_pb.rb +50 -0
  21. data/lib/google/chat/v1/deletion_metadata_pb.rb +43 -0
  22. data/lib/google/chat/v1/group_pb.rb +42 -0
  23. data/lib/google/chat/v1/history_state_pb.rb +42 -0
  24. data/lib/google/chat/v1/matched_url_pb.rb +44 -0
  25. data/lib/google/chat/v1/membership_pb.rb +61 -0
  26. data/lib/google/chat/v1/message_pb.rb +89 -0
  27. data/lib/google/chat/v1/reaction_pb.rb +54 -0
  28. data/lib/google/chat/v1/slash_command_pb.rb +42 -0
  29. data/lib/google/chat/v1/space_pb.rb +63 -0
  30. data/lib/google/chat/v1/space_read_state_pb.rb +51 -0
  31. data/lib/google/chat/v1/space_setup_pb.rb +48 -0
  32. data/lib/google/chat/v1/thread_read_state_pb.rb +48 -0
  33. data/lib/google/chat/v1/user_pb.rb +46 -0
  34. data/lib/google/chat/v1/widgets_pb.rb +53 -0
  35. data/lib/google-apps-chat-v1.rb +21 -0
  36. data/proto_docs/README.md +4 -0
  37. data/proto_docs/google/api/client.rb +399 -0
  38. data/proto_docs/google/api/field_behavior.rb +85 -0
  39. data/proto_docs/google/api/launch_stage.rb +71 -0
  40. data/proto_docs/google/api/resource.rb +222 -0
  41. data/proto_docs/google/apps/card/v1/card.rb +2076 -0
  42. data/proto_docs/google/chat/v1/action_status.rb +40 -0
  43. data/proto_docs/google/chat/v1/annotation.rb +186 -0
  44. data/proto_docs/google/chat/v1/attachment.rb +131 -0
  45. data/proto_docs/google/chat/v1/contextual_addon.rb +120 -0
  46. data/proto_docs/google/chat/v1/deletion_metadata.rb +60 -0
  47. data/proto_docs/google/chat/v1/group.rb +41 -0
  48. data/proto_docs/google/chat/v1/history_state.rb +42 -0
  49. data/proto_docs/google/chat/v1/matched_url.rb +37 -0
  50. data/proto_docs/google/chat/v1/membership.rb +295 -0
  51. data/proto_docs/google/chat/v1/message.rb +657 -0
  52. data/proto_docs/google/chat/v1/reaction.rb +185 -0
  53. data/proto_docs/google/chat/v1/slash_command.rb +37 -0
  54. data/proto_docs/google/chat/v1/space.rb +381 -0
  55. data/proto_docs/google/chat/v1/space_read_state.rb +104 -0
  56. data/proto_docs/google/chat/v1/space_setup.rb +92 -0
  57. data/proto_docs/google/chat/v1/thread_read_state.rb +66 -0
  58. data/proto_docs/google/chat/v1/user.rb +84 -0
  59. data/proto_docs/google/chat/v1/widgets.rb +293 -0
  60. data/proto_docs/google/protobuf/duration.rb +98 -0
  61. data/proto_docs/google/protobuf/empty.rb +34 -0
  62. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  63. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  64. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  65. data/proto_docs/google/rpc/code.rb +185 -0
  66. data/proto_docs/google/type/color.rb +173 -0
  67. metadata +128 -10
@@ -0,0 +1,3497 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/chat/v1/chat_service_pb"
21
+ require "google/apps/chat/v1/chat_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Apps
25
+ module Chat
26
+ module V1
27
+ module ChatService
28
+ module Rest
29
+ ##
30
+ # REST client for the ChatService service.
31
+ #
32
+ # Enables developers to build Chat apps and
33
+ # integrations on Google Chat Platform.
34
+ #
35
+ class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "chat.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :chat_service_stub
43
+
44
+ ##
45
+ # Configure the ChatService Client class.
46
+ #
47
+ # See {::Google::Apps::Chat::V1::ChatService::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all ChatService clients
53
+ # ::Google::Apps::Chat::V1::ChatService::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Apps", "Chat", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.create_message.timeout = 30.0
74
+ default_config.rpcs.create_message.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.list_messages.timeout = 30.0
79
+ default_config.rpcs.list_messages.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.list_memberships.timeout = 30.0
84
+ default_config.rpcs.list_memberships.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
86
+ }
87
+
88
+ default_config.rpcs.get_membership.timeout = 30.0
89
+ default_config.rpcs.get_membership.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config.rpcs.get_message.timeout = 30.0
94
+ default_config.rpcs.get_message.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.update_message.timeout = 30.0
99
+ default_config.rpcs.update_message.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.delete_message.timeout = 30.0
104
+ default_config.rpcs.delete_message.retry_policy = {
105
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
106
+ }
107
+
108
+ default_config.rpcs.get_attachment.timeout = 30.0
109
+ default_config.rpcs.get_attachment.retry_policy = {
110
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
111
+ }
112
+
113
+ default_config.rpcs.upload_attachment.timeout = 30.0
114
+ default_config.rpcs.upload_attachment.retry_policy = {
115
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
116
+ }
117
+
118
+ default_config.rpcs.list_spaces.timeout = 30.0
119
+ default_config.rpcs.list_spaces.retry_policy = {
120
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
121
+ }
122
+
123
+ default_config.rpcs.get_space.timeout = 30.0
124
+ default_config.rpcs.get_space.retry_policy = {
125
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
126
+ }
127
+
128
+ default_config.rpcs.create_space.timeout = 30.0
129
+ default_config.rpcs.create_space.retry_policy = {
130
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
131
+ }
132
+
133
+ default_config.rpcs.set_up_space.timeout = 30.0
134
+ default_config.rpcs.set_up_space.retry_policy = {
135
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
136
+ }
137
+
138
+ default_config.rpcs.update_space.timeout = 30.0
139
+ default_config.rpcs.update_space.retry_policy = {
140
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
141
+ }
142
+
143
+ default_config.rpcs.delete_space.timeout = 30.0
144
+ default_config.rpcs.delete_space.retry_policy = {
145
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
146
+ }
147
+
148
+ default_config.rpcs.complete_import_space.timeout = 30.0
149
+ default_config.rpcs.complete_import_space.retry_policy = {
150
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
151
+ }
152
+
153
+ default_config.rpcs.find_direct_message.timeout = 30.0
154
+ default_config.rpcs.find_direct_message.retry_policy = {
155
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
156
+ }
157
+
158
+ default_config.rpcs.create_membership.timeout = 30.0
159
+ default_config.rpcs.create_membership.retry_policy = {
160
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
161
+ }
162
+
163
+ default_config.rpcs.update_membership.timeout = 30.0
164
+ default_config.rpcs.update_membership.retry_policy = {
165
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
166
+ }
167
+
168
+ default_config.rpcs.delete_membership.timeout = 30.0
169
+ default_config.rpcs.delete_membership.retry_policy = {
170
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
171
+ }
172
+
173
+ default_config.rpcs.create_reaction.timeout = 30.0
174
+ default_config.rpcs.create_reaction.retry_policy = {
175
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
176
+ }
177
+
178
+ default_config.rpcs.list_reactions.timeout = 30.0
179
+ default_config.rpcs.list_reactions.retry_policy = {
180
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
181
+ }
182
+
183
+ default_config.rpcs.delete_reaction.timeout = 30.0
184
+ default_config.rpcs.delete_reaction.retry_policy = {
185
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
186
+ }
187
+
188
+ default_config.rpcs.get_space_read_state.timeout = 30.0
189
+ default_config.rpcs.get_space_read_state.retry_policy = {
190
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
191
+ }
192
+
193
+ default_config.rpcs.update_space_read_state.timeout = 30.0
194
+ default_config.rpcs.update_space_read_state.retry_policy = {
195
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
196
+ }
197
+
198
+ default_config.rpcs.get_thread_read_state.timeout = 30.0
199
+ default_config.rpcs.get_thread_read_state.retry_policy = {
200
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
201
+ }
202
+
203
+ default_config
204
+ end
205
+ yield @configure if block_given?
206
+ @configure
207
+ end
208
+
209
+ ##
210
+ # Configure the ChatService Client instance.
211
+ #
212
+ # The configuration is set to the derived mode, meaning that values can be changed,
213
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
214
+ # should be made on {Client.configure}.
215
+ #
216
+ # See {::Google::Apps::Chat::V1::ChatService::Rest::Client::Configuration}
217
+ # for a description of the configuration fields.
218
+ #
219
+ # @yield [config] Configure the Client client.
220
+ # @yieldparam config [Client::Configuration]
221
+ #
222
+ # @return [Client::Configuration]
223
+ #
224
+ def configure
225
+ yield @config if block_given?
226
+ @config
227
+ end
228
+
229
+ ##
230
+ # The effective universe domain
231
+ #
232
+ # @return [String]
233
+ #
234
+ def universe_domain
235
+ @chat_service_stub.universe_domain
236
+ end
237
+
238
+ ##
239
+ # Create a new ChatService REST client object.
240
+ #
241
+ # @example
242
+ #
243
+ # # Create a client using the default configuration
244
+ # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new
245
+ #
246
+ # # Create a client using a custom configuration
247
+ # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config|
248
+ # config.timeout = 10.0
249
+ # end
250
+ #
251
+ # @yield [config] Configure the ChatService client.
252
+ # @yieldparam config [Client::Configuration]
253
+ #
254
+ def initialize
255
+ # Create the configuration object
256
+ @config = Configuration.new Client.configure
257
+
258
+ # Yield the configuration if needed
259
+ yield @config if block_given?
260
+
261
+ # Create credentials
262
+ credentials = @config.credentials
263
+ # Use self-signed JWT if the endpoint is unchanged from default,
264
+ # but only if the default endpoint does not have a region prefix.
265
+ enable_self_signed_jwt = @config.endpoint.nil? ||
266
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
267
+ !@config.endpoint.split(".").first.include?("-"))
268
+ credentials ||= Credentials.default scope: @config.scope,
269
+ enable_self_signed_jwt: enable_self_signed_jwt
270
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
271
+ credentials = Credentials.new credentials, scope: @config.scope
272
+ end
273
+
274
+ @quota_project_id = @config.quota_project
275
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
276
+
277
+ @chat_service_stub = ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.new(
278
+ endpoint: @config.endpoint,
279
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
280
+ universe_domain: @config.universe_domain,
281
+ credentials: credentials
282
+ )
283
+ end
284
+
285
+ # Service calls
286
+
287
+ ##
288
+ # Creates a message in a Google Chat space. The maximum message size,
289
+ # including text and cards, is 32,000 bytes. For an example, see [Send a
290
+ # message](https://developers.google.com/workspace/chat/create-messages).
291
+ #
292
+ # Calling this method requires
293
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize)
294
+ # and supports the following authentication types:
295
+ #
296
+ # - For text messages, user authentication or app authentication are
297
+ # supported.
298
+ # - For card messages, only app authentication is supported. (Only Chat apps
299
+ # can create card messages.)
300
+ #
301
+ # @overload create_message(request, options = nil)
302
+ # Pass arguments to `create_message` via a request object, either of type
303
+ # {::Google::Apps::Chat::V1::CreateMessageRequest} or an equivalent Hash.
304
+ #
305
+ # @param request [::Google::Apps::Chat::V1::CreateMessageRequest, ::Hash]
306
+ # A request object representing the call parameters. Required. To specify no
307
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
308
+ # @param options [::Gapic::CallOptions, ::Hash]
309
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
310
+ #
311
+ # @overload create_message(parent: nil, message: nil, thread_key: nil, request_id: nil, message_reply_option: nil, message_id: nil)
312
+ # Pass arguments to `create_message` via keyword arguments. Note that at
313
+ # least one keyword argument is required. To specify no parameters, or to keep all
314
+ # the default parameter values, pass an empty Hash as a request object (see above).
315
+ #
316
+ # @param parent [::String]
317
+ # Required. The resource name of the space in which to create a message.
318
+ #
319
+ # Format: `spaces/{space}`
320
+ # @param message [::Google::Apps::Chat::V1::Message, ::Hash]
321
+ # Required. Message body.
322
+ # @param thread_key [::String]
323
+ # Optional. Deprecated: Use
324
+ # {::Google::Apps::Chat::V1::Thread#thread_key thread.thread_key} instead. ID for the
325
+ # thread. Supports up to 4000 characters. To start or add to a thread, create
326
+ # a message and specify a `threadKey` or the
327
+ # {::Google::Apps::Chat::V1::Thread#name thread.name}. For example usage, see [Start or
328
+ # reply to a message
329
+ # thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread).
330
+ # @param request_id [::String]
331
+ # Optional. A unique request ID for this message. Specifying an existing
332
+ # request ID returns the message created with that ID instead of creating a
333
+ # new message.
334
+ # @param message_reply_option [::Google::Apps::Chat::V1::CreateMessageRequest::MessageReplyOption]
335
+ # Optional. Specifies whether a message starts a thread or replies to one.
336
+ # Only supported in named spaces.
337
+ # @param message_id [::String]
338
+ # Optional. A custom ID for a message. Lets Chat apps get, update, or delete
339
+ # a message without needing to store the system-assigned ID in the message's
340
+ # resource name (represented in the message `name` field).
341
+ #
342
+ # The value for this field must meet the following requirements:
343
+ #
344
+ # * Begins with `client-`. For example, `client-custom-name` is a valid
345
+ # custom ID, but `custom-name` is not.
346
+ # * Contains up to 63 characters and only lowercase letters, numbers, and
347
+ # hyphens.
348
+ # * Is unique within a space. A Chat app can't use the same custom ID for
349
+ # different messages.
350
+ #
351
+ # For details, see [Name a
352
+ # message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).
353
+ # @yield [result, operation] Access the result along with the TransportOperation object
354
+ # @yieldparam result [::Google::Apps::Chat::V1::Message]
355
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
356
+ #
357
+ # @return [::Google::Apps::Chat::V1::Message]
358
+ #
359
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
360
+ #
361
+ # @example Basic example
362
+ # require "google/apps/chat/v1"
363
+ #
364
+ # # Create a client object. The client can be reused for multiple calls.
365
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
366
+ #
367
+ # # Create a request. To set request fields, pass in keyword arguments.
368
+ # request = Google::Apps::Chat::V1::CreateMessageRequest.new
369
+ #
370
+ # # Call the create_message method.
371
+ # result = client.create_message request
372
+ #
373
+ # # The returned object is of type Google::Apps::Chat::V1::Message.
374
+ # p result
375
+ #
376
+ def create_message request, options = nil
377
+ raise ::ArgumentError, "request must be provided" if request.nil?
378
+
379
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMessageRequest
380
+
381
+ # Converts hash and nil to an options object
382
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
383
+
384
+ # Customize the options with defaults
385
+ call_metadata = @config.rpcs.create_message.metadata.to_h
386
+
387
+ # Set x-goog-api-client and x-goog-user-project headers
388
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
389
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
390
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
391
+ transports_version_send: [:rest]
392
+
393
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
394
+
395
+ options.apply_defaults timeout: @config.rpcs.create_message.timeout,
396
+ metadata: call_metadata,
397
+ retry_policy: @config.rpcs.create_message.retry_policy
398
+
399
+ options.apply_defaults timeout: @config.timeout,
400
+ metadata: @config.metadata,
401
+ retry_policy: @config.retry_policy
402
+
403
+ @chat_service_stub.create_message request, options do |result, operation|
404
+ yield result, operation if block_given?
405
+ return result
406
+ end
407
+ rescue ::Gapic::Rest::Error => e
408
+ raise ::Google::Cloud::Error.from_error(e)
409
+ end
410
+
411
+ ##
412
+ # Lists messages in a space that the caller is a member of, including
413
+ # messages from blocked members and spaces. For an example, see
414
+ # [List messages](/chat/api/guides/v1/messages/list).
415
+ # Requires [user
416
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
417
+ #
418
+ # @overload list_messages(request, options = nil)
419
+ # Pass arguments to `list_messages` via a request object, either of type
420
+ # {::Google::Apps::Chat::V1::ListMessagesRequest} or an equivalent Hash.
421
+ #
422
+ # @param request [::Google::Apps::Chat::V1::ListMessagesRequest, ::Hash]
423
+ # A request object representing the call parameters. Required. To specify no
424
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
425
+ # @param options [::Gapic::CallOptions, ::Hash]
426
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
427
+ #
428
+ # @overload list_messages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil)
429
+ # Pass arguments to `list_messages` via keyword arguments. Note that at
430
+ # least one keyword argument is required. To specify no parameters, or to keep all
431
+ # the default parameter values, pass an empty Hash as a request object (see above).
432
+ #
433
+ # @param parent [::String]
434
+ # Required. The resource name of the space to list messages from.
435
+ #
436
+ # Format: `spaces/{space}`
437
+ # @param page_size [::Integer]
438
+ # The maximum number of messages returned. The service might return fewer
439
+ # messages than this value.
440
+ #
441
+ # If unspecified, at most 25 are returned.
442
+ #
443
+ # The maximum value is 1000. If you use a value more than 1000, it's
444
+ # automatically changed to 1000.
445
+ #
446
+ # Negative values return an `INVALID_ARGUMENT` error.
447
+ # @param page_token [::String]
448
+ # Optional, if resuming from a previous query.
449
+ #
450
+ # A page token received from a previous list messages call. Provide this
451
+ # parameter to retrieve the subsequent page.
452
+ #
453
+ # When paginating, all other parameters provided should match the call that
454
+ # provided the page token. Passing different values to the other parameters
455
+ # might lead to unexpected results.
456
+ # @param filter [::String]
457
+ # A query filter.
458
+ #
459
+ # You can filter messages by date (`create_time`) and thread (`thread.name`).
460
+ #
461
+ # To filter messages by the date they were created, specify the `create_time`
462
+ # with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339)
463
+ # format and double quotation marks. For example,
464
+ # `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to
465
+ # list messages that were created after a timestamp, or the less than
466
+ # operator `<` to list messages that were created before a timestamp. To
467
+ # filter messages within a time interval, use the `AND` operator between two
468
+ # timestamps.
469
+ #
470
+ # To filter by thread, specify the `thread.name`, formatted as
471
+ # `spaces/{space}/threads/{thread}`. You can only specify one
472
+ # `thread.name` per query.
473
+ #
474
+ # To filter by both thread and date, use the `AND` operator in your query.
475
+ #
476
+ # For example, the following queries are valid:
477
+ #
478
+ # ```
479
+ # create_time > "2012-04-21T11:30:00-04:00"
480
+ #
481
+ # create_time > "2012-04-21T11:30:00-04:00" AND
482
+ # thread.name = spaces/AAAAAAAAAAA/threads/123
483
+ #
484
+ # create_time > "2012-04-21T11:30:00+00:00" AND
485
+ #
486
+ # create_time < "2013-01-01T00:00:00+00:00" AND
487
+ # thread.name = spaces/AAAAAAAAAAA/threads/123
488
+ #
489
+ # thread.name = spaces/AAAAAAAAAAA/threads/123
490
+ # ```
491
+ #
492
+ # Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
493
+ # error.
494
+ # @param order_by [::String]
495
+ # Optional, if resuming from a previous query.
496
+ #
497
+ # How the list of messages is ordered. Specify a value to order by an
498
+ # ordering operation. Valid ordering operation values are as follows:
499
+ #
500
+ # - `ASC` for ascending.
501
+ #
502
+ # - `DESC` for descending.
503
+ #
504
+ # The default ordering is `create_time ASC`.
505
+ # @param show_deleted [::Boolean]
506
+ # Whether to include deleted messages. Deleted messages include deleted time
507
+ # and metadata about their deletion, but message content is unavailable.
508
+ # @yield [result, operation] Access the result along with the TransportOperation object
509
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>]
510
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
511
+ #
512
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>]
513
+ #
514
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
515
+ #
516
+ # @example Basic example
517
+ # require "google/apps/chat/v1"
518
+ #
519
+ # # Create a client object. The client can be reused for multiple calls.
520
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
521
+ #
522
+ # # Create a request. To set request fields, pass in keyword arguments.
523
+ # request = Google::Apps::Chat::V1::ListMessagesRequest.new
524
+ #
525
+ # # Call the list_messages method.
526
+ # result = client.list_messages request
527
+ #
528
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
529
+ # # over elements, and API calls will be issued to fetch pages as needed.
530
+ # result.each do |item|
531
+ # # Each element is of type ::Google::Apps::Chat::V1::Message.
532
+ # p item
533
+ # end
534
+ #
535
+ def list_messages request, options = nil
536
+ raise ::ArgumentError, "request must be provided" if request.nil?
537
+
538
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMessagesRequest
539
+
540
+ # Converts hash and nil to an options object
541
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
542
+
543
+ # Customize the options with defaults
544
+ call_metadata = @config.rpcs.list_messages.metadata.to_h
545
+
546
+ # Set x-goog-api-client and x-goog-user-project headers
547
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
548
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
549
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
550
+ transports_version_send: [:rest]
551
+
552
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
553
+
554
+ options.apply_defaults timeout: @config.rpcs.list_messages.timeout,
555
+ metadata: call_metadata,
556
+ retry_policy: @config.rpcs.list_messages.retry_policy
557
+
558
+ options.apply_defaults timeout: @config.timeout,
559
+ metadata: @config.metadata,
560
+ retry_policy: @config.retry_policy
561
+
562
+ @chat_service_stub.list_messages request, options do |result, operation|
563
+ result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_messages, "messages", request, result, options
564
+ yield result, operation if block_given?
565
+ return result
566
+ end
567
+ rescue ::Gapic::Rest::Error => e
568
+ raise ::Google::Cloud::Error.from_error(e)
569
+ end
570
+
571
+ ##
572
+ # Lists memberships in a space. For an example, see [List users and Google
573
+ # Chat apps in a
574
+ # space](https://developers.google.com/workspace/chat/list-members). Listing
575
+ # memberships with [app
576
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
577
+ # lists memberships in spaces that the Chat app has
578
+ # access to, but excludes Chat app memberships,
579
+ # including its own. Listing memberships with
580
+ # [User
581
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
582
+ # lists memberships in spaces that the authenticated user has access to.
583
+ #
584
+ # Requires
585
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
586
+ # Supports
587
+ # [app
588
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
589
+ # and [user
590
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
591
+ #
592
+ # @overload list_memberships(request, options = nil)
593
+ # Pass arguments to `list_memberships` via a request object, either of type
594
+ # {::Google::Apps::Chat::V1::ListMembershipsRequest} or an equivalent Hash.
595
+ #
596
+ # @param request [::Google::Apps::Chat::V1::ListMembershipsRequest, ::Hash]
597
+ # A request object representing the call parameters. Required. To specify no
598
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
599
+ # @param options [::Gapic::CallOptions, ::Hash]
600
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
601
+ #
602
+ # @overload list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, show_groups: nil, show_invited: nil)
603
+ # Pass arguments to `list_memberships` via keyword arguments. Note that at
604
+ # least one keyword argument is required. To specify no parameters, or to keep all
605
+ # the default parameter values, pass an empty Hash as a request object (see above).
606
+ #
607
+ # @param parent [::String]
608
+ # Required. The resource name of the space for which to fetch a membership
609
+ # list.
610
+ #
611
+ # Format: spaces/\\{space}
612
+ # @param page_size [::Integer]
613
+ # Optional. The maximum number of memberships to return. The service might
614
+ # return fewer than this value.
615
+ #
616
+ # If unspecified, at most 100 memberships are returned.
617
+ #
618
+ # The maximum value is 1000. If you use a value more than 1000, it's
619
+ # automatically changed to 1000.
620
+ #
621
+ # Negative values return an `INVALID_ARGUMENT` error.
622
+ # @param page_token [::String]
623
+ # Optional. A page token, received from a previous call to list memberships.
624
+ # Provide this parameter to retrieve the subsequent page.
625
+ #
626
+ # When paginating, all other parameters provided should match the call that
627
+ # provided the page token. Passing different values to the other parameters
628
+ # might lead to unexpected results.
629
+ # @param filter [::String]
630
+ # Optional. A query filter.
631
+ #
632
+ # You can filter memberships by a member's role
633
+ # ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole))
634
+ # and type
635
+ # ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)).
636
+ #
637
+ # To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.
638
+ #
639
+ # To filter by type, set `member.type` to `HUMAN` or `BOT`.
640
+ #
641
+ # To filter by both role and type, use the `AND` operator. To filter by
642
+ # either role or type, use the `OR` operator.
643
+ #
644
+ # For example, the following queries are valid:
645
+ #
646
+ # ```
647
+ # role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
648
+ # member.type = "HUMAN" AND role = "ROLE_MANAGER"
649
+ # ```
650
+ #
651
+ # The following queries are invalid:
652
+ #
653
+ # ```
654
+ # member.type = "HUMAN" AND member.type = "BOT"
655
+ # role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
656
+ # ```
657
+ #
658
+ #
659
+ # Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
660
+ # error.
661
+ # @param show_groups [::Boolean]
662
+ # Optional. When `true`, also returns memberships associated with a
663
+ # {::Google::Apps::Chat::V1::Membership#group_member Google Group}, in
664
+ # addition to other types of memberships. If a
665
+ # {::Google::Apps::Chat::V1::ListMembershipsRequest#filter filter} is set,
666
+ # {::Google::Apps::Chat::V1::Membership#group_member Google Group}
667
+ # memberships that don't match the filter criteria aren't returned.
668
+ # @param show_invited [::Boolean]
669
+ # Optional. When `true`, also returns memberships associated with
670
+ # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} members, in
671
+ # addition to other types of memberships. If a
672
+ # filter is set,
673
+ # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} memberships
674
+ # that don't match the filter criteria aren't returned.
675
+ #
676
+ # Currently requires [user
677
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
678
+ # @yield [result, operation] Access the result along with the TransportOperation object
679
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>]
680
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
681
+ #
682
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>]
683
+ #
684
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
685
+ #
686
+ # @example Basic example
687
+ # require "google/apps/chat/v1"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Apps::Chat::V1::ListMembershipsRequest.new
694
+ #
695
+ # # Call the list_memberships method.
696
+ # result = client.list_memberships request
697
+ #
698
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
699
+ # # over elements, and API calls will be issued to fetch pages as needed.
700
+ # result.each do |item|
701
+ # # Each element is of type ::Google::Apps::Chat::V1::Membership.
702
+ # p item
703
+ # end
704
+ #
705
+ def list_memberships request, options = nil
706
+ raise ::ArgumentError, "request must be provided" if request.nil?
707
+
708
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMembershipsRequest
709
+
710
+ # Converts hash and nil to an options object
711
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
712
+
713
+ # Customize the options with defaults
714
+ call_metadata = @config.rpcs.list_memberships.metadata.to_h
715
+
716
+ # Set x-goog-api-client and x-goog-user-project headers
717
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
718
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
719
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
720
+ transports_version_send: [:rest]
721
+
722
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
723
+
724
+ options.apply_defaults timeout: @config.rpcs.list_memberships.timeout,
725
+ metadata: call_metadata,
726
+ retry_policy: @config.rpcs.list_memberships.retry_policy
727
+
728
+ options.apply_defaults timeout: @config.timeout,
729
+ metadata: @config.metadata,
730
+ retry_policy: @config.retry_policy
731
+
732
+ @chat_service_stub.list_memberships request, options do |result, operation|
733
+ result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_memberships, "memberships", request, result, options
734
+ yield result, operation if block_given?
735
+ return result
736
+ end
737
+ rescue ::Gapic::Rest::Error => e
738
+ raise ::Google::Cloud::Error.from_error(e)
739
+ end
740
+
741
+ ##
742
+ # Returns details about a membership. For an example, see
743
+ # [Get details about a user's or Google Chat app's
744
+ # membership](https://developers.google.com/workspace/chat/get-members).
745
+ #
746
+ # Requires
747
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
748
+ # Supports
749
+ # [app
750
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
751
+ # and [user
752
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
753
+ #
754
+ # @overload get_membership(request, options = nil)
755
+ # Pass arguments to `get_membership` via a request object, either of type
756
+ # {::Google::Apps::Chat::V1::GetMembershipRequest} or an equivalent Hash.
757
+ #
758
+ # @param request [::Google::Apps::Chat::V1::GetMembershipRequest, ::Hash]
759
+ # A request object representing the call parameters. Required. To specify no
760
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
761
+ # @param options [::Gapic::CallOptions, ::Hash]
762
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
763
+ #
764
+ # @overload get_membership(name: nil)
765
+ # Pass arguments to `get_membership` via keyword arguments. Note that at
766
+ # least one keyword argument is required. To specify no parameters, or to keep all
767
+ # the default parameter values, pass an empty Hash as a request object (see above).
768
+ #
769
+ # @param name [::String]
770
+ # Required. Resource name of the membership to retrieve.
771
+ #
772
+ # To get the app's own membership [by using user
773
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
774
+ # you can optionally use `spaces/{space}/members/app`.
775
+ #
776
+ # Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
777
+ #
778
+ # When [authenticated as a
779
+ # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
780
+ # you can use the user's email as an alias for `{member}`. For example,
781
+ # `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
782
+ # email of the Google Chat user.
783
+ # @yield [result, operation] Access the result along with the TransportOperation object
784
+ # @yieldparam result [::Google::Apps::Chat::V1::Membership]
785
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
786
+ #
787
+ # @return [::Google::Apps::Chat::V1::Membership]
788
+ #
789
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
790
+ #
791
+ # @example Basic example
792
+ # require "google/apps/chat/v1"
793
+ #
794
+ # # Create a client object. The client can be reused for multiple calls.
795
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
796
+ #
797
+ # # Create a request. To set request fields, pass in keyword arguments.
798
+ # request = Google::Apps::Chat::V1::GetMembershipRequest.new
799
+ #
800
+ # # Call the get_membership method.
801
+ # result = client.get_membership request
802
+ #
803
+ # # The returned object is of type Google::Apps::Chat::V1::Membership.
804
+ # p result
805
+ #
806
+ def get_membership request, options = nil
807
+ raise ::ArgumentError, "request must be provided" if request.nil?
808
+
809
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMembershipRequest
810
+
811
+ # Converts hash and nil to an options object
812
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
813
+
814
+ # Customize the options with defaults
815
+ call_metadata = @config.rpcs.get_membership.metadata.to_h
816
+
817
+ # Set x-goog-api-client and x-goog-user-project headers
818
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
819
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
820
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
821
+ transports_version_send: [:rest]
822
+
823
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
824
+
825
+ options.apply_defaults timeout: @config.rpcs.get_membership.timeout,
826
+ metadata: call_metadata,
827
+ retry_policy: @config.rpcs.get_membership.retry_policy
828
+
829
+ options.apply_defaults timeout: @config.timeout,
830
+ metadata: @config.metadata,
831
+ retry_policy: @config.retry_policy
832
+
833
+ @chat_service_stub.get_membership request, options do |result, operation|
834
+ yield result, operation if block_given?
835
+ return result
836
+ end
837
+ rescue ::Gapic::Rest::Error => e
838
+ raise ::Google::Cloud::Error.from_error(e)
839
+ end
840
+
841
+ ##
842
+ # Returns details about a message.
843
+ # For an example, see [Get details about a
844
+ # message](https://developers.google.com/workspace/chat/get-messages).
845
+ #
846
+ # Requires
847
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
848
+ # Supports
849
+ # [app
850
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
851
+ # and [user
852
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
853
+ #
854
+ # Note: Might return a message from a blocked member or space.
855
+ #
856
+ # @overload get_message(request, options = nil)
857
+ # Pass arguments to `get_message` via a request object, either of type
858
+ # {::Google::Apps::Chat::V1::GetMessageRequest} or an equivalent Hash.
859
+ #
860
+ # @param request [::Google::Apps::Chat::V1::GetMessageRequest, ::Hash]
861
+ # A request object representing the call parameters. Required. To specify no
862
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
863
+ # @param options [::Gapic::CallOptions, ::Hash]
864
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
865
+ #
866
+ # @overload get_message(name: nil)
867
+ # Pass arguments to `get_message` via keyword arguments. Note that at
868
+ # least one keyword argument is required. To specify no parameters, or to keep all
869
+ # the default parameter values, pass an empty Hash as a request object (see above).
870
+ #
871
+ # @param name [::String]
872
+ # Required. Resource name of the message.
873
+ #
874
+ # Format: `spaces/{space}/messages/{message}`
875
+ #
876
+ # If you've set a custom ID for your message, you can use the value from the
877
+ # `clientAssignedMessageId` field for `{message}`. For details, see [Name a
878
+ # message]
879
+ # (https://developers.google.com/workspace/chat/create-messages#name_a_created_message).
880
+ # @yield [result, operation] Access the result along with the TransportOperation object
881
+ # @yieldparam result [::Google::Apps::Chat::V1::Message]
882
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
883
+ #
884
+ # @return [::Google::Apps::Chat::V1::Message]
885
+ #
886
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
887
+ #
888
+ # @example Basic example
889
+ # require "google/apps/chat/v1"
890
+ #
891
+ # # Create a client object. The client can be reused for multiple calls.
892
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
893
+ #
894
+ # # Create a request. To set request fields, pass in keyword arguments.
895
+ # request = Google::Apps::Chat::V1::GetMessageRequest.new
896
+ #
897
+ # # Call the get_message method.
898
+ # result = client.get_message request
899
+ #
900
+ # # The returned object is of type Google::Apps::Chat::V1::Message.
901
+ # p result
902
+ #
903
+ def get_message request, options = nil
904
+ raise ::ArgumentError, "request must be provided" if request.nil?
905
+
906
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMessageRequest
907
+
908
+ # Converts hash and nil to an options object
909
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
910
+
911
+ # Customize the options with defaults
912
+ call_metadata = @config.rpcs.get_message.metadata.to_h
913
+
914
+ # Set x-goog-api-client and x-goog-user-project headers
915
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
916
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
917
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
918
+ transports_version_send: [:rest]
919
+
920
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
921
+
922
+ options.apply_defaults timeout: @config.rpcs.get_message.timeout,
923
+ metadata: call_metadata,
924
+ retry_policy: @config.rpcs.get_message.retry_policy
925
+
926
+ options.apply_defaults timeout: @config.timeout,
927
+ metadata: @config.metadata,
928
+ retry_policy: @config.retry_policy
929
+
930
+ @chat_service_stub.get_message request, options do |result, operation|
931
+ yield result, operation if block_given?
932
+ return result
933
+ end
934
+ rescue ::Gapic::Rest::Error => e
935
+ raise ::Google::Cloud::Error.from_error(e)
936
+ end
937
+
938
+ ##
939
+ # Updates a message. There's a difference between the `patch` and `update`
940
+ # methods. The `patch`
941
+ # method uses a `patch` request while the `update` method uses a `put`
942
+ # request. We recommend using the `patch` method. For an example, see
943
+ # [Update a
944
+ # message](https://developers.google.com/workspace/chat/update-messages).
945
+ #
946
+ # Requires
947
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
948
+ # Supports
949
+ # [app
950
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
951
+ # and [user
952
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
953
+ # When using app authentication, requests can only update messages
954
+ # created by the calling Chat app.
955
+ #
956
+ # @overload update_message(request, options = nil)
957
+ # Pass arguments to `update_message` via a request object, either of type
958
+ # {::Google::Apps::Chat::V1::UpdateMessageRequest} or an equivalent Hash.
959
+ #
960
+ # @param request [::Google::Apps::Chat::V1::UpdateMessageRequest, ::Hash]
961
+ # A request object representing the call parameters. Required. To specify no
962
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
963
+ # @param options [::Gapic::CallOptions, ::Hash]
964
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
965
+ #
966
+ # @overload update_message(message: nil, update_mask: nil, allow_missing: nil)
967
+ # Pass arguments to `update_message` via keyword arguments. Note that at
968
+ # least one keyword argument is required. To specify no parameters, or to keep all
969
+ # the default parameter values, pass an empty Hash as a request object (see above).
970
+ #
971
+ # @param message [::Google::Apps::Chat::V1::Message, ::Hash]
972
+ # Required. Message with fields updated.
973
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
974
+ # Required. The field paths to update. Separate multiple values with commas
975
+ # or use `*` to update all field paths.
976
+ #
977
+ # Currently supported field paths:
978
+ #
979
+ # - `text`
980
+ #
981
+ # - `attachment`
982
+ #
983
+ # - `cards` (Requires [app
984
+ # authentication](/chat/api/guides/auth/service-accounts).)
985
+ #
986
+ # - `cards_v2` (Requires [app
987
+ # authentication](/chat/api/guides/auth/service-accounts).)
988
+ #
989
+ # - `accessory_widgets` (Requires [app
990
+ # authentication](/chat/api/guides/auth/service-accounts).)
991
+ # @param allow_missing [::Boolean]
992
+ # Optional. If `true` and the message isn't found, a new message is created
993
+ # and `updateMask` is ignored. The specified message ID must be
994
+ # [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message)
995
+ # or the request fails.
996
+ # @yield [result, operation] Access the result along with the TransportOperation object
997
+ # @yieldparam result [::Google::Apps::Chat::V1::Message]
998
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
999
+ #
1000
+ # @return [::Google::Apps::Chat::V1::Message]
1001
+ #
1002
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1003
+ #
1004
+ # @example Basic example
1005
+ # require "google/apps/chat/v1"
1006
+ #
1007
+ # # Create a client object. The client can be reused for multiple calls.
1008
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1009
+ #
1010
+ # # Create a request. To set request fields, pass in keyword arguments.
1011
+ # request = Google::Apps::Chat::V1::UpdateMessageRequest.new
1012
+ #
1013
+ # # Call the update_message method.
1014
+ # result = client.update_message request
1015
+ #
1016
+ # # The returned object is of type Google::Apps::Chat::V1::Message.
1017
+ # p result
1018
+ #
1019
+ def update_message request, options = nil
1020
+ raise ::ArgumentError, "request must be provided" if request.nil?
1021
+
1022
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMessageRequest
1023
+
1024
+ # Converts hash and nil to an options object
1025
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1026
+
1027
+ # Customize the options with defaults
1028
+ call_metadata = @config.rpcs.update_message.metadata.to_h
1029
+
1030
+ # Set x-goog-api-client and x-goog-user-project headers
1031
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1032
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1033
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1034
+ transports_version_send: [:rest]
1035
+
1036
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1037
+
1038
+ options.apply_defaults timeout: @config.rpcs.update_message.timeout,
1039
+ metadata: call_metadata,
1040
+ retry_policy: @config.rpcs.update_message.retry_policy
1041
+
1042
+ options.apply_defaults timeout: @config.timeout,
1043
+ metadata: @config.metadata,
1044
+ retry_policy: @config.retry_policy
1045
+
1046
+ @chat_service_stub.update_message request, options do |result, operation|
1047
+ yield result, operation if block_given?
1048
+ return result
1049
+ end
1050
+ rescue ::Gapic::Rest::Error => e
1051
+ raise ::Google::Cloud::Error.from_error(e)
1052
+ end
1053
+
1054
+ ##
1055
+ # Deletes a message.
1056
+ # For an example, see [Delete a
1057
+ # message](https://developers.google.com/workspace/chat/delete-messages).
1058
+ #
1059
+ # Requires
1060
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
1061
+ # Supports
1062
+ # [app
1063
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1064
+ # and [user
1065
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1066
+ # When using app authentication, requests can only delete messages
1067
+ # created by the calling Chat app.
1068
+ #
1069
+ # @overload delete_message(request, options = nil)
1070
+ # Pass arguments to `delete_message` via a request object, either of type
1071
+ # {::Google::Apps::Chat::V1::DeleteMessageRequest} or an equivalent Hash.
1072
+ #
1073
+ # @param request [::Google::Apps::Chat::V1::DeleteMessageRequest, ::Hash]
1074
+ # A request object representing the call parameters. Required. To specify no
1075
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1076
+ # @param options [::Gapic::CallOptions, ::Hash]
1077
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1078
+ #
1079
+ # @overload delete_message(name: nil, force: nil)
1080
+ # Pass arguments to `delete_message` via keyword arguments. Note that at
1081
+ # least one keyword argument is required. To specify no parameters, or to keep all
1082
+ # the default parameter values, pass an empty Hash as a request object (see above).
1083
+ #
1084
+ # @param name [::String]
1085
+ # Required. Resource name of the message.
1086
+ #
1087
+ # Format: `spaces/{space}/messages/{message}`
1088
+ #
1089
+ # If you've set a custom ID for your message, you can use the value from the
1090
+ # `clientAssignedMessageId` field for `{message}`. For details, see [Name a
1091
+ # message]
1092
+ # (https://developers.google.com/workspace/chat/create-messages#name_a_created_message).
1093
+ # @param force [::Boolean]
1094
+ # When `true`, deleting a message also deletes its threaded replies. When
1095
+ # `false`, if a message has threaded replies, deletion fails.
1096
+ #
1097
+ # Only applies when [authenticating as a
1098
+ # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1099
+ # Has no effect when [authenticating as a Chat app]
1100
+ # (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
1101
+ # @yield [result, operation] Access the result along with the TransportOperation object
1102
+ # @yieldparam result [::Google::Protobuf::Empty]
1103
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1104
+ #
1105
+ # @return [::Google::Protobuf::Empty]
1106
+ #
1107
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1108
+ #
1109
+ # @example Basic example
1110
+ # require "google/apps/chat/v1"
1111
+ #
1112
+ # # Create a client object. The client can be reused for multiple calls.
1113
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1114
+ #
1115
+ # # Create a request. To set request fields, pass in keyword arguments.
1116
+ # request = Google::Apps::Chat::V1::DeleteMessageRequest.new
1117
+ #
1118
+ # # Call the delete_message method.
1119
+ # result = client.delete_message request
1120
+ #
1121
+ # # The returned object is of type Google::Protobuf::Empty.
1122
+ # p result
1123
+ #
1124
+ def delete_message request, options = nil
1125
+ raise ::ArgumentError, "request must be provided" if request.nil?
1126
+
1127
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMessageRequest
1128
+
1129
+ # Converts hash and nil to an options object
1130
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1131
+
1132
+ # Customize the options with defaults
1133
+ call_metadata = @config.rpcs.delete_message.metadata.to_h
1134
+
1135
+ # Set x-goog-api-client and x-goog-user-project headers
1136
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1137
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1138
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1139
+ transports_version_send: [:rest]
1140
+
1141
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1142
+
1143
+ options.apply_defaults timeout: @config.rpcs.delete_message.timeout,
1144
+ metadata: call_metadata,
1145
+ retry_policy: @config.rpcs.delete_message.retry_policy
1146
+
1147
+ options.apply_defaults timeout: @config.timeout,
1148
+ metadata: @config.metadata,
1149
+ retry_policy: @config.retry_policy
1150
+
1151
+ @chat_service_stub.delete_message request, options do |result, operation|
1152
+ yield result, operation if block_given?
1153
+ return result
1154
+ end
1155
+ rescue ::Gapic::Rest::Error => e
1156
+ raise ::Google::Cloud::Error.from_error(e)
1157
+ end
1158
+
1159
+ ##
1160
+ # Gets the metadata of a message attachment. The attachment data is fetched
1161
+ # using the [media
1162
+ # API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download).
1163
+ # For an example, see
1164
+ # [Get metadata about a message
1165
+ # attachment](https://developers.google.com/workspace/chat/get-media-attachments).
1166
+ # Requires [app
1167
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
1168
+ #
1169
+ # @overload get_attachment(request, options = nil)
1170
+ # Pass arguments to `get_attachment` via a request object, either of type
1171
+ # {::Google::Apps::Chat::V1::GetAttachmentRequest} or an equivalent Hash.
1172
+ #
1173
+ # @param request [::Google::Apps::Chat::V1::GetAttachmentRequest, ::Hash]
1174
+ # A request object representing the call parameters. Required. To specify no
1175
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1176
+ # @param options [::Gapic::CallOptions, ::Hash]
1177
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1178
+ #
1179
+ # @overload get_attachment(name: nil)
1180
+ # Pass arguments to `get_attachment` via keyword arguments. Note that at
1181
+ # least one keyword argument is required. To specify no parameters, or to keep all
1182
+ # the default parameter values, pass an empty Hash as a request object (see above).
1183
+ #
1184
+ # @param name [::String]
1185
+ # Required. Resource name of the attachment, in the form
1186
+ # `spaces/*/messages/*/attachments/*`.
1187
+ # @yield [result, operation] Access the result along with the TransportOperation object
1188
+ # @yieldparam result [::Google::Apps::Chat::V1::Attachment]
1189
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1190
+ #
1191
+ # @return [::Google::Apps::Chat::V1::Attachment]
1192
+ #
1193
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1194
+ #
1195
+ # @example Basic example
1196
+ # require "google/apps/chat/v1"
1197
+ #
1198
+ # # Create a client object. The client can be reused for multiple calls.
1199
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1200
+ #
1201
+ # # Create a request. To set request fields, pass in keyword arguments.
1202
+ # request = Google::Apps::Chat::V1::GetAttachmentRequest.new
1203
+ #
1204
+ # # Call the get_attachment method.
1205
+ # result = client.get_attachment request
1206
+ #
1207
+ # # The returned object is of type Google::Apps::Chat::V1::Attachment.
1208
+ # p result
1209
+ #
1210
+ def get_attachment request, options = nil
1211
+ raise ::ArgumentError, "request must be provided" if request.nil?
1212
+
1213
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetAttachmentRequest
1214
+
1215
+ # Converts hash and nil to an options object
1216
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1217
+
1218
+ # Customize the options with defaults
1219
+ call_metadata = @config.rpcs.get_attachment.metadata.to_h
1220
+
1221
+ # Set x-goog-api-client and x-goog-user-project headers
1222
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1223
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1224
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1225
+ transports_version_send: [:rest]
1226
+
1227
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1228
+
1229
+ options.apply_defaults timeout: @config.rpcs.get_attachment.timeout,
1230
+ metadata: call_metadata,
1231
+ retry_policy: @config.rpcs.get_attachment.retry_policy
1232
+
1233
+ options.apply_defaults timeout: @config.timeout,
1234
+ metadata: @config.metadata,
1235
+ retry_policy: @config.retry_policy
1236
+
1237
+ @chat_service_stub.get_attachment request, options do |result, operation|
1238
+ yield result, operation if block_given?
1239
+ return result
1240
+ end
1241
+ rescue ::Gapic::Rest::Error => e
1242
+ raise ::Google::Cloud::Error.from_error(e)
1243
+ end
1244
+
1245
+ ##
1246
+ # Uploads an attachment. For an example, see
1247
+ # [Upload media as a file
1248
+ # attachment](https://developers.google.com/workspace/chat/upload-media-attachments).
1249
+ # Requires user
1250
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1251
+ #
1252
+ # You can upload attachments up to 200 MB. Certain file types aren't
1253
+ # supported. For details, see [File types blocked by Google
1254
+ # Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
1255
+ #
1256
+ # @overload upload_attachment(request, options = nil)
1257
+ # Pass arguments to `upload_attachment` via a request object, either of type
1258
+ # {::Google::Apps::Chat::V1::UploadAttachmentRequest} or an equivalent Hash.
1259
+ #
1260
+ # @param request [::Google::Apps::Chat::V1::UploadAttachmentRequest, ::Hash]
1261
+ # A request object representing the call parameters. Required. To specify no
1262
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1263
+ # @param options [::Gapic::CallOptions, ::Hash]
1264
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1265
+ #
1266
+ # @overload upload_attachment(parent: nil, filename: nil)
1267
+ # Pass arguments to `upload_attachment` via keyword arguments. Note that at
1268
+ # least one keyword argument is required. To specify no parameters, or to keep all
1269
+ # the default parameter values, pass an empty Hash as a request object (see above).
1270
+ #
1271
+ # @param parent [::String]
1272
+ # Required. Resource name of the Chat space in which the attachment is
1273
+ # uploaded. Format "spaces/\\{space}".
1274
+ # @param filename [::String]
1275
+ # Required. The filename of the attachment, including the file extension.
1276
+ # @yield [result, operation] Access the result along with the TransportOperation object
1277
+ # @yieldparam result [::Google::Apps::Chat::V1::UploadAttachmentResponse]
1278
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1279
+ #
1280
+ # @return [::Google::Apps::Chat::V1::UploadAttachmentResponse]
1281
+ #
1282
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1283
+ #
1284
+ # @example Basic example
1285
+ # require "google/apps/chat/v1"
1286
+ #
1287
+ # # Create a client object. The client can be reused for multiple calls.
1288
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1289
+ #
1290
+ # # Create a request. To set request fields, pass in keyword arguments.
1291
+ # request = Google::Apps::Chat::V1::UploadAttachmentRequest.new
1292
+ #
1293
+ # # Call the upload_attachment method.
1294
+ # result = client.upload_attachment request
1295
+ #
1296
+ # # The returned object is of type Google::Apps::Chat::V1::UploadAttachmentResponse.
1297
+ # p result
1298
+ #
1299
+ def upload_attachment request, options = nil
1300
+ raise ::ArgumentError, "request must be provided" if request.nil?
1301
+
1302
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UploadAttachmentRequest
1303
+
1304
+ # Converts hash and nil to an options object
1305
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1306
+
1307
+ # Customize the options with defaults
1308
+ call_metadata = @config.rpcs.upload_attachment.metadata.to_h
1309
+
1310
+ # Set x-goog-api-client and x-goog-user-project headers
1311
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1312
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1313
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1314
+ transports_version_send: [:rest]
1315
+
1316
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1317
+
1318
+ options.apply_defaults timeout: @config.rpcs.upload_attachment.timeout,
1319
+ metadata: call_metadata,
1320
+ retry_policy: @config.rpcs.upload_attachment.retry_policy
1321
+
1322
+ options.apply_defaults timeout: @config.timeout,
1323
+ metadata: @config.metadata,
1324
+ retry_policy: @config.retry_policy
1325
+
1326
+ @chat_service_stub.upload_attachment request, options do |result, operation|
1327
+ yield result, operation if block_given?
1328
+ return result
1329
+ end
1330
+ rescue ::Gapic::Rest::Error => e
1331
+ raise ::Google::Cloud::Error.from_error(e)
1332
+ end
1333
+
1334
+ ##
1335
+ # Lists spaces the caller is a member of. Group chats and DMs aren't listed
1336
+ # until the first message is sent. For an example, see
1337
+ # [List
1338
+ # spaces](https://developers.google.com/workspace/chat/list-spaces).
1339
+ #
1340
+ # Requires
1341
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
1342
+ # Supports
1343
+ # [app
1344
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1345
+ # and [user
1346
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1347
+ #
1348
+ # Lists spaces visible to the caller or authenticated user. Group chats
1349
+ # and DMs aren't listed until the first message is sent.
1350
+ #
1351
+ # @overload list_spaces(request, options = nil)
1352
+ # Pass arguments to `list_spaces` via a request object, either of type
1353
+ # {::Google::Apps::Chat::V1::ListSpacesRequest} or an equivalent Hash.
1354
+ #
1355
+ # @param request [::Google::Apps::Chat::V1::ListSpacesRequest, ::Hash]
1356
+ # A request object representing the call parameters. Required. To specify no
1357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1358
+ # @param options [::Gapic::CallOptions, ::Hash]
1359
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1360
+ #
1361
+ # @overload list_spaces(page_size: nil, page_token: nil, filter: nil)
1362
+ # Pass arguments to `list_spaces` via keyword arguments. Note that at
1363
+ # least one keyword argument is required. To specify no parameters, or to keep all
1364
+ # the default parameter values, pass an empty Hash as a request object (see above).
1365
+ #
1366
+ # @param page_size [::Integer]
1367
+ # Optional. The maximum number of spaces to return. The service might return
1368
+ # fewer than this value.
1369
+ #
1370
+ # If unspecified, at most 100 spaces are returned.
1371
+ #
1372
+ # The maximum value is 1000. If you use a value more than 1000, it's
1373
+ # automatically changed to 1000.
1374
+ #
1375
+ # Negative values return an `INVALID_ARGUMENT` error.
1376
+ # @param page_token [::String]
1377
+ # Optional. A page token, received from a previous list spaces call.
1378
+ # Provide this parameter to retrieve the subsequent page.
1379
+ #
1380
+ # When paginating, the filter value should match the call that provided the
1381
+ # page token. Passing a different value may lead to unexpected results.
1382
+ # @param filter [::String]
1383
+ # Optional. A query filter.
1384
+ #
1385
+ # You can filter spaces by the space type
1386
+ # ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)).
1387
+ #
1388
+ # To filter by space type, you must specify valid enum value, such as
1389
+ # `SPACE` or `GROUP_CHAT` (the `space_type` can't be
1390
+ # `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
1391
+ # operator.
1392
+ #
1393
+ # For example, the following queries are valid:
1394
+ #
1395
+ # ```
1396
+ # space_type = "SPACE"
1397
+ # spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"
1398
+ # ```
1399
+ #
1400
+ # Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
1401
+ # error.
1402
+ # @yield [result, operation] Access the result along with the TransportOperation object
1403
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>]
1404
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1405
+ #
1406
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>]
1407
+ #
1408
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1409
+ #
1410
+ # @example Basic example
1411
+ # require "google/apps/chat/v1"
1412
+ #
1413
+ # # Create a client object. The client can be reused for multiple calls.
1414
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1415
+ #
1416
+ # # Create a request. To set request fields, pass in keyword arguments.
1417
+ # request = Google::Apps::Chat::V1::ListSpacesRequest.new
1418
+ #
1419
+ # # Call the list_spaces method.
1420
+ # result = client.list_spaces request
1421
+ #
1422
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1423
+ # # over elements, and API calls will be issued to fetch pages as needed.
1424
+ # result.each do |item|
1425
+ # # Each element is of type ::Google::Apps::Chat::V1::Space.
1426
+ # p item
1427
+ # end
1428
+ #
1429
+ def list_spaces request, options = nil
1430
+ raise ::ArgumentError, "request must be provided" if request.nil?
1431
+
1432
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSpacesRequest
1433
+
1434
+ # Converts hash and nil to an options object
1435
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1436
+
1437
+ # Customize the options with defaults
1438
+ call_metadata = @config.rpcs.list_spaces.metadata.to_h
1439
+
1440
+ # Set x-goog-api-client and x-goog-user-project headers
1441
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1442
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1443
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1444
+ transports_version_send: [:rest]
1445
+
1446
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1447
+
1448
+ options.apply_defaults timeout: @config.rpcs.list_spaces.timeout,
1449
+ metadata: call_metadata,
1450
+ retry_policy: @config.rpcs.list_spaces.retry_policy
1451
+
1452
+ options.apply_defaults timeout: @config.timeout,
1453
+ metadata: @config.metadata,
1454
+ retry_policy: @config.retry_policy
1455
+
1456
+ @chat_service_stub.list_spaces request, options do |result, operation|
1457
+ result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_spaces, "spaces", request, result, options
1458
+ yield result, operation if block_given?
1459
+ return result
1460
+ end
1461
+ rescue ::Gapic::Rest::Error => e
1462
+ raise ::Google::Cloud::Error.from_error(e)
1463
+ end
1464
+
1465
+ ##
1466
+ # Returns details about a space. For an example, see
1467
+ # [Get details about a
1468
+ # space](https://developers.google.com/workspace/chat/get-spaces).
1469
+ #
1470
+ # Requires
1471
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
1472
+ # Supports
1473
+ # [app
1474
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1475
+ # and [user
1476
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1477
+ #
1478
+ # @overload get_space(request, options = nil)
1479
+ # Pass arguments to `get_space` via a request object, either of type
1480
+ # {::Google::Apps::Chat::V1::GetSpaceRequest} or an equivalent Hash.
1481
+ #
1482
+ # @param request [::Google::Apps::Chat::V1::GetSpaceRequest, ::Hash]
1483
+ # A request object representing the call parameters. Required. To specify no
1484
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1485
+ # @param options [::Gapic::CallOptions, ::Hash]
1486
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1487
+ #
1488
+ # @overload get_space(name: nil)
1489
+ # Pass arguments to `get_space` via keyword arguments. Note that at
1490
+ # least one keyword argument is required. To specify no parameters, or to keep all
1491
+ # the default parameter values, pass an empty Hash as a request object (see above).
1492
+ #
1493
+ # @param name [::String]
1494
+ # Required. Resource name of the space, in the form "spaces/*".
1495
+ #
1496
+ # Format: `spaces/{space}`
1497
+ # @yield [result, operation] Access the result along with the TransportOperation object
1498
+ # @yieldparam result [::Google::Apps::Chat::V1::Space]
1499
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1500
+ #
1501
+ # @return [::Google::Apps::Chat::V1::Space]
1502
+ #
1503
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1504
+ #
1505
+ # @example Basic example
1506
+ # require "google/apps/chat/v1"
1507
+ #
1508
+ # # Create a client object. The client can be reused for multiple calls.
1509
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1510
+ #
1511
+ # # Create a request. To set request fields, pass in keyword arguments.
1512
+ # request = Google::Apps::Chat::V1::GetSpaceRequest.new
1513
+ #
1514
+ # # Call the get_space method.
1515
+ # result = client.get_space request
1516
+ #
1517
+ # # The returned object is of type Google::Apps::Chat::V1::Space.
1518
+ # p result
1519
+ #
1520
+ def get_space request, options = nil
1521
+ raise ::ArgumentError, "request must be provided" if request.nil?
1522
+
1523
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceRequest
1524
+
1525
+ # Converts hash and nil to an options object
1526
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1527
+
1528
+ # Customize the options with defaults
1529
+ call_metadata = @config.rpcs.get_space.metadata.to_h
1530
+
1531
+ # Set x-goog-api-client and x-goog-user-project headers
1532
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1533
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1534
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1535
+ transports_version_send: [:rest]
1536
+
1537
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1538
+
1539
+ options.apply_defaults timeout: @config.rpcs.get_space.timeout,
1540
+ metadata: call_metadata,
1541
+ retry_policy: @config.rpcs.get_space.retry_policy
1542
+
1543
+ options.apply_defaults timeout: @config.timeout,
1544
+ metadata: @config.metadata,
1545
+ retry_policy: @config.retry_policy
1546
+
1547
+ @chat_service_stub.get_space request, options do |result, operation|
1548
+ yield result, operation if block_given?
1549
+ return result
1550
+ end
1551
+ rescue ::Gapic::Rest::Error => e
1552
+ raise ::Google::Cloud::Error.from_error(e)
1553
+ end
1554
+
1555
+ ##
1556
+ # Creates a named space. Spaces grouped by topics aren't supported. For an
1557
+ # example, see [Create a
1558
+ # space](https://developers.google.com/workspace/chat/create-spaces).
1559
+ #
1560
+ # If you receive the error message `ALREADY_EXISTS` when creating
1561
+ # a space, try a different `displayName`. An existing space within
1562
+ # the Google Workspace organization might already use this display name.
1563
+ #
1564
+ # Requires [user
1565
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1566
+ #
1567
+ # @overload create_space(request, options = nil)
1568
+ # Pass arguments to `create_space` via a request object, either of type
1569
+ # {::Google::Apps::Chat::V1::CreateSpaceRequest} or an equivalent Hash.
1570
+ #
1571
+ # @param request [::Google::Apps::Chat::V1::CreateSpaceRequest, ::Hash]
1572
+ # A request object representing the call parameters. Required. To specify no
1573
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1574
+ # @param options [::Gapic::CallOptions, ::Hash]
1575
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1576
+ #
1577
+ # @overload create_space(space: nil, request_id: nil)
1578
+ # Pass arguments to `create_space` via keyword arguments. Note that at
1579
+ # least one keyword argument is required. To specify no parameters, or to keep all
1580
+ # the default parameter values, pass an empty Hash as a request object (see above).
1581
+ #
1582
+ # @param space [::Google::Apps::Chat::V1::Space, ::Hash]
1583
+ # Required. The `displayName` and `spaceType` fields must be populated. Only
1584
+ # `SpaceType.SPACE` is supported.
1585
+ #
1586
+ # If you receive the error message `ALREADY_EXISTS` when creating a space,
1587
+ # try a different `displayName`. An existing space within the Google
1588
+ # Workspace organization might already use this display name.
1589
+ #
1590
+ # The space `name` is assigned on the server so anything specified in this
1591
+ # field will be ignored.
1592
+ # @param request_id [::String]
1593
+ # Optional. A unique identifier for this request.
1594
+ # A random UUID is recommended.
1595
+ # Specifying an existing request ID returns the space created with that ID
1596
+ # instead of creating a new space.
1597
+ # Specifying an existing request ID from the same Chat app with a different
1598
+ # authenticated user returns an error.
1599
+ # @yield [result, operation] Access the result along with the TransportOperation object
1600
+ # @yieldparam result [::Google::Apps::Chat::V1::Space]
1601
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1602
+ #
1603
+ # @return [::Google::Apps::Chat::V1::Space]
1604
+ #
1605
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1606
+ #
1607
+ # @example Basic example
1608
+ # require "google/apps/chat/v1"
1609
+ #
1610
+ # # Create a client object. The client can be reused for multiple calls.
1611
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1612
+ #
1613
+ # # Create a request. To set request fields, pass in keyword arguments.
1614
+ # request = Google::Apps::Chat::V1::CreateSpaceRequest.new
1615
+ #
1616
+ # # Call the create_space method.
1617
+ # result = client.create_space request
1618
+ #
1619
+ # # The returned object is of type Google::Apps::Chat::V1::Space.
1620
+ # p result
1621
+ #
1622
+ def create_space request, options = nil
1623
+ raise ::ArgumentError, "request must be provided" if request.nil?
1624
+
1625
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSpaceRequest
1626
+
1627
+ # Converts hash and nil to an options object
1628
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1629
+
1630
+ # Customize the options with defaults
1631
+ call_metadata = @config.rpcs.create_space.metadata.to_h
1632
+
1633
+ # Set x-goog-api-client and x-goog-user-project headers
1634
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1635
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1636
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1637
+ transports_version_send: [:rest]
1638
+
1639
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1640
+
1641
+ options.apply_defaults timeout: @config.rpcs.create_space.timeout,
1642
+ metadata: call_metadata,
1643
+ retry_policy: @config.rpcs.create_space.retry_policy
1644
+
1645
+ options.apply_defaults timeout: @config.timeout,
1646
+ metadata: @config.metadata,
1647
+ retry_policy: @config.retry_policy
1648
+
1649
+ @chat_service_stub.create_space request, options do |result, operation|
1650
+ yield result, operation if block_given?
1651
+ return result
1652
+ end
1653
+ rescue ::Gapic::Rest::Error => e
1654
+ raise ::Google::Cloud::Error.from_error(e)
1655
+ end
1656
+
1657
+ ##
1658
+ # Creates a space and adds specified users to it. The calling user is
1659
+ # automatically added to the space, and shouldn't be specified as a
1660
+ # membership in the request. For an example, see
1661
+ # [Set up a space with initial
1662
+ # members](https://developers.google.com/workspace/chat/set-up-spaces).
1663
+ #
1664
+ # To specify the human members to add, add memberships with the appropriate
1665
+ # `membership.member.name`. To add a human user, use `users/{user}`, where
1666
+ # `{user}` can be the email address for the user. For users in the same
1667
+ # Workspace organization `{user}` can also be the `id` for the person from
1668
+ # the People API, or the `id` for the user in the Directory API. For example,
1669
+ # if the People API Person profile ID for `user@example.com` is `123456789`,
1670
+ # you can add the user to the space by setting the `membership.member.name`
1671
+ # to `users/user@example.com` or `users/123456789`.
1672
+ #
1673
+ # For a named space or group chat, if the caller blocks, or is blocked
1674
+ # by some members, or doesn't have permission to add some members, then
1675
+ # those members aren't added to the created space.
1676
+ #
1677
+ # To create a direct message (DM) between the calling user and another human
1678
+ # user, specify exactly one membership to represent the human user. If
1679
+ # one user blocks the other, the request fails and the DM isn't created.
1680
+ #
1681
+ # To create a DM between the calling user and the calling app, set
1682
+ # `Space.singleUserBotDm` to `true` and don't specify any memberships. You
1683
+ # can only use this method to set up a DM with the calling app. To add the
1684
+ # calling app as a member of a space or an existing DM between two human
1685
+ # users, see
1686
+ # [Invite or add a user or app to a
1687
+ # space](https://developers.google.com/workspace/chat/create-members).
1688
+ #
1689
+ # If a DM already exists between two users, even when one user blocks the
1690
+ # other at the time a request is made, then the existing DM is returned.
1691
+ #
1692
+ # Spaces with threaded replies aren't supported. If you receive the error
1693
+ # message `ALREADY_EXISTS` when setting up a space, try a different
1694
+ # `displayName`. An existing space within the Google Workspace organization
1695
+ # might already use this display name.
1696
+ #
1697
+ # Requires [user
1698
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1699
+ #
1700
+ # @overload set_up_space(request, options = nil)
1701
+ # Pass arguments to `set_up_space` via a request object, either of type
1702
+ # {::Google::Apps::Chat::V1::SetUpSpaceRequest} or an equivalent Hash.
1703
+ #
1704
+ # @param request [::Google::Apps::Chat::V1::SetUpSpaceRequest, ::Hash]
1705
+ # A request object representing the call parameters. Required. To specify no
1706
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1707
+ # @param options [::Gapic::CallOptions, ::Hash]
1708
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1709
+ #
1710
+ # @overload set_up_space(space: nil, request_id: nil, memberships: nil)
1711
+ # Pass arguments to `set_up_space` via keyword arguments. Note that at
1712
+ # least one keyword argument is required. To specify no parameters, or to keep all
1713
+ # the default parameter values, pass an empty Hash as a request object (see above).
1714
+ #
1715
+ # @param space [::Google::Apps::Chat::V1::Space, ::Hash]
1716
+ # Required. The `Space.spaceType` field is required.
1717
+ #
1718
+ # To create a space, set `Space.spaceType` to `SPACE` and set
1719
+ # `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when
1720
+ # setting up a space, try a different `displayName`. An existing space
1721
+ # within the Google Workspace organization might already use this display
1722
+ # name.
1723
+ #
1724
+ # To create a group chat, set `Space.spaceType` to
1725
+ # `GROUP_CHAT`. Don't set `Space.displayName`.
1726
+ #
1727
+ # To create a 1:1 conversation between humans,
1728
+ # set `Space.spaceType` to `DIRECT_MESSAGE` and set
1729
+ # `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or
1730
+ # `Space.spaceDetails`.
1731
+ #
1732
+ # To create an 1:1 conversation between a human and the calling Chat app, set
1733
+ # `Space.spaceType` to `DIRECT_MESSAGE` and
1734
+ # `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or
1735
+ # `Space.spaceDetails`.
1736
+ #
1737
+ # If a `DIRECT_MESSAGE` space already exists, that space is returned instead
1738
+ # of creating a new space.
1739
+ # @param request_id [::String]
1740
+ # Optional. A unique identifier for this request.
1741
+ # A random UUID is recommended.
1742
+ # Specifying an existing request ID returns the space created with that ID
1743
+ # instead of creating a new space.
1744
+ # Specifying an existing request ID from the same Chat app with a different
1745
+ # authenticated user returns an error.
1746
+ # @param memberships [::Array<::Google::Apps::Chat::V1::Membership, ::Hash>]
1747
+ # Optional. The Google Chat users to invite to join the space. Omit the
1748
+ # calling user, as they are added automatically.
1749
+ #
1750
+ # The set currently allows up to 20 memberships (in addition to the caller).
1751
+ #
1752
+ # For human membership, the `Membership.member` field must contain a `user`
1753
+ # with `name` populated (format: `users/{user}`) and `type` set to
1754
+ # `User.Type.HUMAN`. You can only add human users when setting up a space
1755
+ # (adding Chat apps is only supported for direct message setup with the
1756
+ # calling app). You can also add members using the user's email as an alias
1757
+ # for \\{user}. For example, the `user.name` can be `users/example@gmail.com`.
1758
+ # To invite Gmail users or users from external Google Workspace domains,
1759
+ # user's email must be used for `{user}`.
1760
+ #
1761
+ # Optional when setting `Space.spaceType` to `SPACE`.
1762
+ #
1763
+ # Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at
1764
+ # least two memberships.
1765
+ #
1766
+ # Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human
1767
+ # user, along with exactly one membership.
1768
+ #
1769
+ # Must be empty when creating a 1:1 conversation between a human and the
1770
+ # calling Chat app (when setting `Space.spaceType` to
1771
+ # `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`).
1772
+ # @yield [result, operation] Access the result along with the TransportOperation object
1773
+ # @yieldparam result [::Google::Apps::Chat::V1::Space]
1774
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1775
+ #
1776
+ # @return [::Google::Apps::Chat::V1::Space]
1777
+ #
1778
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1779
+ #
1780
+ # @example Basic example
1781
+ # require "google/apps/chat/v1"
1782
+ #
1783
+ # # Create a client object. The client can be reused for multiple calls.
1784
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1785
+ #
1786
+ # # Create a request. To set request fields, pass in keyword arguments.
1787
+ # request = Google::Apps::Chat::V1::SetUpSpaceRequest.new
1788
+ #
1789
+ # # Call the set_up_space method.
1790
+ # result = client.set_up_space request
1791
+ #
1792
+ # # The returned object is of type Google::Apps::Chat::V1::Space.
1793
+ # p result
1794
+ #
1795
+ def set_up_space request, options = nil
1796
+ raise ::ArgumentError, "request must be provided" if request.nil?
1797
+
1798
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SetUpSpaceRequest
1799
+
1800
+ # Converts hash and nil to an options object
1801
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1802
+
1803
+ # Customize the options with defaults
1804
+ call_metadata = @config.rpcs.set_up_space.metadata.to_h
1805
+
1806
+ # Set x-goog-api-client and x-goog-user-project headers
1807
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1808
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1809
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1810
+ transports_version_send: [:rest]
1811
+
1812
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1813
+
1814
+ options.apply_defaults timeout: @config.rpcs.set_up_space.timeout,
1815
+ metadata: call_metadata,
1816
+ retry_policy: @config.rpcs.set_up_space.retry_policy
1817
+
1818
+ options.apply_defaults timeout: @config.timeout,
1819
+ metadata: @config.metadata,
1820
+ retry_policy: @config.retry_policy
1821
+
1822
+ @chat_service_stub.set_up_space request, options do |result, operation|
1823
+ yield result, operation if block_given?
1824
+ return result
1825
+ end
1826
+ rescue ::Gapic::Rest::Error => e
1827
+ raise ::Google::Cloud::Error.from_error(e)
1828
+ end
1829
+
1830
+ ##
1831
+ # Updates a space. For an example, see
1832
+ # [Update a
1833
+ # space](https://developers.google.com/workspace/chat/update-spaces).
1834
+ #
1835
+ # If you're updating the `displayName` field and receive the error message
1836
+ # `ALREADY_EXISTS`, try a different display name.. An existing space within
1837
+ # the Google Workspace organization might already use this display name.
1838
+ #
1839
+ # Requires [user
1840
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1841
+ #
1842
+ # @overload update_space(request, options = nil)
1843
+ # Pass arguments to `update_space` via a request object, either of type
1844
+ # {::Google::Apps::Chat::V1::UpdateSpaceRequest} or an equivalent Hash.
1845
+ #
1846
+ # @param request [::Google::Apps::Chat::V1::UpdateSpaceRequest, ::Hash]
1847
+ # A request object representing the call parameters. Required. To specify no
1848
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1849
+ # @param options [::Gapic::CallOptions, ::Hash]
1850
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1851
+ #
1852
+ # @overload update_space(space: nil, update_mask: nil)
1853
+ # Pass arguments to `update_space` via keyword arguments. Note that at
1854
+ # least one keyword argument is required. To specify no parameters, or to keep all
1855
+ # the default parameter values, pass an empty Hash as a request object (see above).
1856
+ #
1857
+ # @param space [::Google::Apps::Chat::V1::Space, ::Hash]
1858
+ # Required. Space with fields to be updated. `Space.name` must be
1859
+ # populated in the form of `spaces/{space}`. Only fields
1860
+ # specified by `update_mask` are updated.
1861
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1862
+ # Required. The updated field paths, comma separated if there are
1863
+ # multiple.
1864
+ #
1865
+ # Currently supported field paths:
1866
+ #
1867
+ # - `display_name` (Only supports changing the display name of a space with
1868
+ # the `SPACE` type, or when also including the `space_type` mask to change a
1869
+ # `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a
1870
+ # `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument
1871
+ # error. If you receive the error message `ALREADY_EXISTS` when updating the
1872
+ # `displayName`, try a different `displayName`. An existing space within the
1873
+ # Google Workspace organization might already use this display name.)
1874
+ #
1875
+ # - `space_type` (Only supports changing a `GROUP_CHAT` space type to
1876
+ # `SPACE`. Include `display_name` together
1877
+ # with `space_type` in the update mask and ensure that the specified space
1878
+ # has a non-empty display name and the `SPACE` space type. Including the
1879
+ # `space_type` mask and the `SPACE` type in the specified space when updating
1880
+ # the display name is optional if the existing space already has the `SPACE`
1881
+ # type. Trying to update the space type in other ways results in an invalid
1882
+ # argument error).
1883
+ #
1884
+ # - `space_details`
1885
+ #
1886
+ # - `space_history_state` (Supports [turning history on or off for the
1887
+ # space](https://support.google.com/chat/answer/7664687) if [the organization
1888
+ # allows users to change their history
1889
+ # setting](https://support.google.com/a/answer/7664184).
1890
+ # Warning: mutually exclusive with all other field paths.)
1891
+ #
1892
+ # - Developer Preview: `access_settings.audience` (Supports changing the
1893
+ # [access setting](https://support.google.com/chat/answer/11971020) of a
1894
+ # space. If no audience is specified in the access setting, the space's
1895
+ # access setting is updated to restricted. Warning: mutually exclusive with
1896
+ # all other field paths.)
1897
+ # @yield [result, operation] Access the result along with the TransportOperation object
1898
+ # @yieldparam result [::Google::Apps::Chat::V1::Space]
1899
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1900
+ #
1901
+ # @return [::Google::Apps::Chat::V1::Space]
1902
+ #
1903
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1904
+ #
1905
+ # @example Basic example
1906
+ # require "google/apps/chat/v1"
1907
+ #
1908
+ # # Create a client object. The client can be reused for multiple calls.
1909
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1910
+ #
1911
+ # # Create a request. To set request fields, pass in keyword arguments.
1912
+ # request = Google::Apps::Chat::V1::UpdateSpaceRequest.new
1913
+ #
1914
+ # # Call the update_space method.
1915
+ # result = client.update_space request
1916
+ #
1917
+ # # The returned object is of type Google::Apps::Chat::V1::Space.
1918
+ # p result
1919
+ #
1920
+ def update_space request, options = nil
1921
+ raise ::ArgumentError, "request must be provided" if request.nil?
1922
+
1923
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceRequest
1924
+
1925
+ # Converts hash and nil to an options object
1926
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1927
+
1928
+ # Customize the options with defaults
1929
+ call_metadata = @config.rpcs.update_space.metadata.to_h
1930
+
1931
+ # Set x-goog-api-client and x-goog-user-project headers
1932
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1933
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1934
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
1935
+ transports_version_send: [:rest]
1936
+
1937
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1938
+
1939
+ options.apply_defaults timeout: @config.rpcs.update_space.timeout,
1940
+ metadata: call_metadata,
1941
+ retry_policy: @config.rpcs.update_space.retry_policy
1942
+
1943
+ options.apply_defaults timeout: @config.timeout,
1944
+ metadata: @config.metadata,
1945
+ retry_policy: @config.retry_policy
1946
+
1947
+ @chat_service_stub.update_space request, options do |result, operation|
1948
+ yield result, operation if block_given?
1949
+ return result
1950
+ end
1951
+ rescue ::Gapic::Rest::Error => e
1952
+ raise ::Google::Cloud::Error.from_error(e)
1953
+ end
1954
+
1955
+ ##
1956
+ # Deletes a named space. Always performs a cascading delete, which means
1957
+ # that the space's child resources—like messages posted in the space and
1958
+ # memberships in the space—are also deleted. For an example, see
1959
+ # [Delete a
1960
+ # space](https://developers.google.com/workspace/chat/delete-spaces).
1961
+ # Requires [user
1962
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1963
+ # from a user who has permission to delete the space.
1964
+ #
1965
+ # @overload delete_space(request, options = nil)
1966
+ # Pass arguments to `delete_space` via a request object, either of type
1967
+ # {::Google::Apps::Chat::V1::DeleteSpaceRequest} or an equivalent Hash.
1968
+ #
1969
+ # @param request [::Google::Apps::Chat::V1::DeleteSpaceRequest, ::Hash]
1970
+ # A request object representing the call parameters. Required. To specify no
1971
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1972
+ # @param options [::Gapic::CallOptions, ::Hash]
1973
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1974
+ #
1975
+ # @overload delete_space(name: nil)
1976
+ # Pass arguments to `delete_space` via keyword arguments. Note that at
1977
+ # least one keyword argument is required. To specify no parameters, or to keep all
1978
+ # the default parameter values, pass an empty Hash as a request object (see above).
1979
+ #
1980
+ # @param name [::String]
1981
+ # Required. Resource name of the space to delete.
1982
+ #
1983
+ # Format: `spaces/{space}`
1984
+ # @yield [result, operation] Access the result along with the TransportOperation object
1985
+ # @yieldparam result [::Google::Protobuf::Empty]
1986
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1987
+ #
1988
+ # @return [::Google::Protobuf::Empty]
1989
+ #
1990
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1991
+ #
1992
+ # @example Basic example
1993
+ # require "google/apps/chat/v1"
1994
+ #
1995
+ # # Create a client object. The client can be reused for multiple calls.
1996
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
1997
+ #
1998
+ # # Create a request. To set request fields, pass in keyword arguments.
1999
+ # request = Google::Apps::Chat::V1::DeleteSpaceRequest.new
2000
+ #
2001
+ # # Call the delete_space method.
2002
+ # result = client.delete_space request
2003
+ #
2004
+ # # The returned object is of type Google::Protobuf::Empty.
2005
+ # p result
2006
+ #
2007
+ def delete_space request, options = nil
2008
+ raise ::ArgumentError, "request must be provided" if request.nil?
2009
+
2010
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSpaceRequest
2011
+
2012
+ # Converts hash and nil to an options object
2013
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2014
+
2015
+ # Customize the options with defaults
2016
+ call_metadata = @config.rpcs.delete_space.metadata.to_h
2017
+
2018
+ # Set x-goog-api-client and x-goog-user-project headers
2019
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2020
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2021
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2022
+ transports_version_send: [:rest]
2023
+
2024
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2025
+
2026
+ options.apply_defaults timeout: @config.rpcs.delete_space.timeout,
2027
+ metadata: call_metadata,
2028
+ retry_policy: @config.rpcs.delete_space.retry_policy
2029
+
2030
+ options.apply_defaults timeout: @config.timeout,
2031
+ metadata: @config.metadata,
2032
+ retry_policy: @config.retry_policy
2033
+
2034
+ @chat_service_stub.delete_space request, options do |result, operation|
2035
+ yield result, operation if block_given?
2036
+ return result
2037
+ end
2038
+ rescue ::Gapic::Rest::Error => e
2039
+ raise ::Google::Cloud::Error.from_error(e)
2040
+ end
2041
+
2042
+ ##
2043
+ # Completes the
2044
+ # [import process](https://developers.google.com/workspace/chat/import-data)
2045
+ # for the specified space and makes it visible to users.
2046
+ # Requires app authentication and domain-wide delegation. For more
2047
+ # information, see [Authorize Google Chat apps to import
2048
+ # data](https://developers.google.com/workspace/chat/authorize-import).
2049
+ #
2050
+ # @overload complete_import_space(request, options = nil)
2051
+ # Pass arguments to `complete_import_space` via a request object, either of type
2052
+ # {::Google::Apps::Chat::V1::CompleteImportSpaceRequest} or an equivalent Hash.
2053
+ #
2054
+ # @param request [::Google::Apps::Chat::V1::CompleteImportSpaceRequest, ::Hash]
2055
+ # A request object representing the call parameters. Required. To specify no
2056
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2057
+ # @param options [::Gapic::CallOptions, ::Hash]
2058
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2059
+ #
2060
+ # @overload complete_import_space(name: nil)
2061
+ # Pass arguments to `complete_import_space` via keyword arguments. Note that at
2062
+ # least one keyword argument is required. To specify no parameters, or to keep all
2063
+ # the default parameter values, pass an empty Hash as a request object (see above).
2064
+ #
2065
+ # @param name [::String]
2066
+ # Required. Resource name of the import mode space.
2067
+ #
2068
+ # Format: `spaces/{space}`
2069
+ # @yield [result, operation] Access the result along with the TransportOperation object
2070
+ # @yieldparam result [::Google::Apps::Chat::V1::CompleteImportSpaceResponse]
2071
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2072
+ #
2073
+ # @return [::Google::Apps::Chat::V1::CompleteImportSpaceResponse]
2074
+ #
2075
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2076
+ #
2077
+ # @example Basic example
2078
+ # require "google/apps/chat/v1"
2079
+ #
2080
+ # # Create a client object. The client can be reused for multiple calls.
2081
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2082
+ #
2083
+ # # Create a request. To set request fields, pass in keyword arguments.
2084
+ # request = Google::Apps::Chat::V1::CompleteImportSpaceRequest.new
2085
+ #
2086
+ # # Call the complete_import_space method.
2087
+ # result = client.complete_import_space request
2088
+ #
2089
+ # # The returned object is of type Google::Apps::Chat::V1::CompleteImportSpaceResponse.
2090
+ # p result
2091
+ #
2092
+ def complete_import_space request, options = nil
2093
+ raise ::ArgumentError, "request must be provided" if request.nil?
2094
+
2095
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CompleteImportSpaceRequest
2096
+
2097
+ # Converts hash and nil to an options object
2098
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2099
+
2100
+ # Customize the options with defaults
2101
+ call_metadata = @config.rpcs.complete_import_space.metadata.to_h
2102
+
2103
+ # Set x-goog-api-client and x-goog-user-project headers
2104
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2105
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2106
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2107
+ transports_version_send: [:rest]
2108
+
2109
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2110
+
2111
+ options.apply_defaults timeout: @config.rpcs.complete_import_space.timeout,
2112
+ metadata: call_metadata,
2113
+ retry_policy: @config.rpcs.complete_import_space.retry_policy
2114
+
2115
+ options.apply_defaults timeout: @config.timeout,
2116
+ metadata: @config.metadata,
2117
+ retry_policy: @config.retry_policy
2118
+
2119
+ @chat_service_stub.complete_import_space request, options do |result, operation|
2120
+ yield result, operation if block_given?
2121
+ return result
2122
+ end
2123
+ rescue ::Gapic::Rest::Error => e
2124
+ raise ::Google::Cloud::Error.from_error(e)
2125
+ end
2126
+
2127
+ ##
2128
+ # Returns the existing direct message with the specified user. If no direct
2129
+ # message space is found, returns a `404 NOT_FOUND` error. For an example,
2130
+ # see
2131
+ # [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
2132
+ #
2133
+ # With [user
2134
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
2135
+ # returns the direct message space between the specified user and the
2136
+ # authenticated user.
2137
+ #
2138
+ # With [app
2139
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
2140
+ # returns the direct message space between the specified user and the calling
2141
+ # Chat app.
2142
+ #
2143
+ # Requires [user
2144
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2145
+ # or [app
2146
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
2147
+ #
2148
+ # @overload find_direct_message(request, options = nil)
2149
+ # Pass arguments to `find_direct_message` via a request object, either of type
2150
+ # {::Google::Apps::Chat::V1::FindDirectMessageRequest} or an equivalent Hash.
2151
+ #
2152
+ # @param request [::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Hash]
2153
+ # A request object representing the call parameters. Required. To specify no
2154
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2155
+ # @param options [::Gapic::CallOptions, ::Hash]
2156
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2157
+ #
2158
+ # @overload find_direct_message(name: nil)
2159
+ # Pass arguments to `find_direct_message` via keyword arguments. Note that at
2160
+ # least one keyword argument is required. To specify no parameters, or to keep all
2161
+ # the default parameter values, pass an empty Hash as a request object (see above).
2162
+ #
2163
+ # @param name [::String]
2164
+ # Required. Resource name of the user to find direct message with.
2165
+ #
2166
+ # Format: `users/{user}`, where `{user}` is either the `id` for the
2167
+ # [person](https://developers.google.com/people/api/rest/v1/people) from the
2168
+ # People API, or the `id` for the
2169
+ # [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
2170
+ # in the Directory API. For example, if the People API profile ID is
2171
+ # `123456789`, you can find a direct message with that person by using
2172
+ # `users/123456789` as the `name`. When [authenticated as a
2173
+ # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
2174
+ # you can use the email as an alias for `{user}`. For example,
2175
+ # `users/example@gmail.com` where `example@gmail.com` is the email of the
2176
+ # Google Chat user.
2177
+ # @yield [result, operation] Access the result along with the TransportOperation object
2178
+ # @yieldparam result [::Google::Apps::Chat::V1::Space]
2179
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2180
+ #
2181
+ # @return [::Google::Apps::Chat::V1::Space]
2182
+ #
2183
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2184
+ #
2185
+ # @example Basic example
2186
+ # require "google/apps/chat/v1"
2187
+ #
2188
+ # # Create a client object. The client can be reused for multiple calls.
2189
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2190
+ #
2191
+ # # Create a request. To set request fields, pass in keyword arguments.
2192
+ # request = Google::Apps::Chat::V1::FindDirectMessageRequest.new
2193
+ #
2194
+ # # Call the find_direct_message method.
2195
+ # result = client.find_direct_message request
2196
+ #
2197
+ # # The returned object is of type Google::Apps::Chat::V1::Space.
2198
+ # p result
2199
+ #
2200
+ def find_direct_message request, options = nil
2201
+ raise ::ArgumentError, "request must be provided" if request.nil?
2202
+
2203
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindDirectMessageRequest
2204
+
2205
+ # Converts hash and nil to an options object
2206
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2207
+
2208
+ # Customize the options with defaults
2209
+ call_metadata = @config.rpcs.find_direct_message.metadata.to_h
2210
+
2211
+ # Set x-goog-api-client and x-goog-user-project headers
2212
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2213
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2214
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2215
+ transports_version_send: [:rest]
2216
+
2217
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2218
+
2219
+ options.apply_defaults timeout: @config.rpcs.find_direct_message.timeout,
2220
+ metadata: call_metadata,
2221
+ retry_policy: @config.rpcs.find_direct_message.retry_policy
2222
+
2223
+ options.apply_defaults timeout: @config.timeout,
2224
+ metadata: @config.metadata,
2225
+ retry_policy: @config.retry_policy
2226
+
2227
+ @chat_service_stub.find_direct_message request, options do |result, operation|
2228
+ yield result, operation if block_given?
2229
+ return result
2230
+ end
2231
+ rescue ::Gapic::Rest::Error => e
2232
+ raise ::Google::Cloud::Error.from_error(e)
2233
+ end
2234
+
2235
+ ##
2236
+ # Creates a human membership or app membership for the calling app. Creating
2237
+ # memberships for other apps isn't supported. For an example, see
2238
+ # [Invite or add a user or a Google Chat app to a
2239
+ # space](https://developers.google.com/workspace/chat/create-members).
2240
+ # When creating a membership, if the specified member has their auto-accept
2241
+ # policy turned off, then they're invited, and must accept the space
2242
+ # invitation before joining. Otherwise, creating a membership adds the member
2243
+ # directly to the specified space. Requires [user
2244
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2245
+ #
2246
+ # To specify the member to add, set the `membership.member.name` for the
2247
+ # human or app member.
2248
+ #
2249
+ # - To add the calling app to a space or a direct message between two human
2250
+ # users, use `users/app`. Unable to add other
2251
+ # apps to the space.
2252
+ #
2253
+ # - To add a human user, use `users/{user}`, where `{user}` can be the email
2254
+ # address for the user. For users in the same Workspace organization `{user}`
2255
+ # can also be the `id` for the person from the People API, or the `id` for
2256
+ # the user in the Directory API. For example, if the People API Person
2257
+ # profile ID for `user@example.com` is `123456789`, you can add the user to
2258
+ # the space by setting the `membership.member.name` to
2259
+ # `users/user@example.com` or `users/123456789`.
2260
+ #
2261
+ # @overload create_membership(request, options = nil)
2262
+ # Pass arguments to `create_membership` via a request object, either of type
2263
+ # {::Google::Apps::Chat::V1::CreateMembershipRequest} or an equivalent Hash.
2264
+ #
2265
+ # @param request [::Google::Apps::Chat::V1::CreateMembershipRequest, ::Hash]
2266
+ # A request object representing the call parameters. Required. To specify no
2267
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2268
+ # @param options [::Gapic::CallOptions, ::Hash]
2269
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2270
+ #
2271
+ # @overload create_membership(parent: nil, membership: nil)
2272
+ # Pass arguments to `create_membership` via keyword arguments. Note that at
2273
+ # least one keyword argument is required. To specify no parameters, or to keep all
2274
+ # the default parameter values, pass an empty Hash as a request object (see above).
2275
+ #
2276
+ # @param parent [::String]
2277
+ # Required. The resource name of the space for which to create the
2278
+ # membership.
2279
+ #
2280
+ # Format: spaces/\\{space}
2281
+ # @param membership [::Google::Apps::Chat::V1::Membership, ::Hash]
2282
+ # Required. The membership relation to create.
2283
+ # The `memberType` field must contain a user with the `user.name` and
2284
+ # `user.type` fields populated. The server will assign a resource name
2285
+ # and overwrite anything specified.
2286
+ # When a Chat app creates a membership relation for a human user, it must use
2287
+ # the `chat.memberships` scope, set `user.type` to `HUMAN`, and set
2288
+ # `user.name` with format `users/{user}`, where `{user}` can be the email
2289
+ # address for the user. For users in the same Workspace organization `{user}`
2290
+ # can also be the `id` of the
2291
+ # [person](https://developers.google.com/people/api/rest/v1/people) from the
2292
+ # People API, or the `id` for the user in the Directory API. For example, if
2293
+ # the People API Person profile ID for `user@example.com` is `123456789`, you
2294
+ # can add the user to the space by setting the `membership.member.name` to
2295
+ # `users/user@example.com` or `users/123456789`. When a Chat app creates a
2296
+ # membership relation for itself, it must use the `chat.memberships.app`
2297
+ # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`.
2298
+ # @yield [result, operation] Access the result along with the TransportOperation object
2299
+ # @yieldparam result [::Google::Apps::Chat::V1::Membership]
2300
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2301
+ #
2302
+ # @return [::Google::Apps::Chat::V1::Membership]
2303
+ #
2304
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2305
+ #
2306
+ # @example Basic example
2307
+ # require "google/apps/chat/v1"
2308
+ #
2309
+ # # Create a client object. The client can be reused for multiple calls.
2310
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2311
+ #
2312
+ # # Create a request. To set request fields, pass in keyword arguments.
2313
+ # request = Google::Apps::Chat::V1::CreateMembershipRequest.new
2314
+ #
2315
+ # # Call the create_membership method.
2316
+ # result = client.create_membership request
2317
+ #
2318
+ # # The returned object is of type Google::Apps::Chat::V1::Membership.
2319
+ # p result
2320
+ #
2321
+ def create_membership request, options = nil
2322
+ raise ::ArgumentError, "request must be provided" if request.nil?
2323
+
2324
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMembershipRequest
2325
+
2326
+ # Converts hash and nil to an options object
2327
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2328
+
2329
+ # Customize the options with defaults
2330
+ call_metadata = @config.rpcs.create_membership.metadata.to_h
2331
+
2332
+ # Set x-goog-api-client and x-goog-user-project headers
2333
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2334
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2335
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2336
+ transports_version_send: [:rest]
2337
+
2338
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2339
+
2340
+ options.apply_defaults timeout: @config.rpcs.create_membership.timeout,
2341
+ metadata: call_metadata,
2342
+ retry_policy: @config.rpcs.create_membership.retry_policy
2343
+
2344
+ options.apply_defaults timeout: @config.timeout,
2345
+ metadata: @config.metadata,
2346
+ retry_policy: @config.retry_policy
2347
+
2348
+ @chat_service_stub.create_membership request, options do |result, operation|
2349
+ yield result, operation if block_given?
2350
+ return result
2351
+ end
2352
+ rescue ::Gapic::Rest::Error => e
2353
+ raise ::Google::Cloud::Error.from_error(e)
2354
+ end
2355
+
2356
+ ##
2357
+ # Updates a membership. For an example, see [Update a user's membership in
2358
+ # a space](https://developers.google.com/workspace/chat/update-members).
2359
+ #
2360
+ # Requires [user
2361
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2362
+ #
2363
+ # @overload update_membership(request, options = nil)
2364
+ # Pass arguments to `update_membership` via a request object, either of type
2365
+ # {::Google::Apps::Chat::V1::UpdateMembershipRequest} or an equivalent Hash.
2366
+ #
2367
+ # @param request [::Google::Apps::Chat::V1::UpdateMembershipRequest, ::Hash]
2368
+ # A request object representing the call parameters. Required. To specify no
2369
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2370
+ # @param options [::Gapic::CallOptions, ::Hash]
2371
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2372
+ #
2373
+ # @overload update_membership(membership: nil, update_mask: nil)
2374
+ # Pass arguments to `update_membership` via keyword arguments. Note that at
2375
+ # least one keyword argument is required. To specify no parameters, or to keep all
2376
+ # the default parameter values, pass an empty Hash as a request object (see above).
2377
+ #
2378
+ # @param membership [::Google::Apps::Chat::V1::Membership, ::Hash]
2379
+ # Required. The membership to update. Only fields specified by `update_mask`
2380
+ # are updated.
2381
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2382
+ # Required. The field paths to update. Separate multiple values with commas
2383
+ # or use `*` to update all field paths.
2384
+ #
2385
+ # Currently supported field paths:
2386
+ #
2387
+ # - `role`
2388
+ # @yield [result, operation] Access the result along with the TransportOperation object
2389
+ # @yieldparam result [::Google::Apps::Chat::V1::Membership]
2390
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2391
+ #
2392
+ # @return [::Google::Apps::Chat::V1::Membership]
2393
+ #
2394
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2395
+ #
2396
+ # @example Basic example
2397
+ # require "google/apps/chat/v1"
2398
+ #
2399
+ # # Create a client object. The client can be reused for multiple calls.
2400
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2401
+ #
2402
+ # # Create a request. To set request fields, pass in keyword arguments.
2403
+ # request = Google::Apps::Chat::V1::UpdateMembershipRequest.new
2404
+ #
2405
+ # # Call the update_membership method.
2406
+ # result = client.update_membership request
2407
+ #
2408
+ # # The returned object is of type Google::Apps::Chat::V1::Membership.
2409
+ # p result
2410
+ #
2411
+ def update_membership request, options = nil
2412
+ raise ::ArgumentError, "request must be provided" if request.nil?
2413
+
2414
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMembershipRequest
2415
+
2416
+ # Converts hash and nil to an options object
2417
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2418
+
2419
+ # Customize the options with defaults
2420
+ call_metadata = @config.rpcs.update_membership.metadata.to_h
2421
+
2422
+ # Set x-goog-api-client and x-goog-user-project headers
2423
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2424
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2425
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2426
+ transports_version_send: [:rest]
2427
+
2428
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2429
+
2430
+ options.apply_defaults timeout: @config.rpcs.update_membership.timeout,
2431
+ metadata: call_metadata,
2432
+ retry_policy: @config.rpcs.update_membership.retry_policy
2433
+
2434
+ options.apply_defaults timeout: @config.timeout,
2435
+ metadata: @config.metadata,
2436
+ retry_policy: @config.retry_policy
2437
+
2438
+ @chat_service_stub.update_membership request, options do |result, operation|
2439
+ yield result, operation if block_given?
2440
+ return result
2441
+ end
2442
+ rescue ::Gapic::Rest::Error => e
2443
+ raise ::Google::Cloud::Error.from_error(e)
2444
+ end
2445
+
2446
+ ##
2447
+ # Deletes a membership. For an example, see
2448
+ # [Remove a user or a Google Chat app from a
2449
+ # space](https://developers.google.com/workspace/chat/delete-members).
2450
+ #
2451
+ # Requires [user
2452
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2453
+ #
2454
+ # @overload delete_membership(request, options = nil)
2455
+ # Pass arguments to `delete_membership` via a request object, either of type
2456
+ # {::Google::Apps::Chat::V1::DeleteMembershipRequest} or an equivalent Hash.
2457
+ #
2458
+ # @param request [::Google::Apps::Chat::V1::DeleteMembershipRequest, ::Hash]
2459
+ # A request object representing the call parameters. Required. To specify no
2460
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2461
+ # @param options [::Gapic::CallOptions, ::Hash]
2462
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2463
+ #
2464
+ # @overload delete_membership(name: nil)
2465
+ # Pass arguments to `delete_membership` via keyword arguments. Note that at
2466
+ # least one keyword argument is required. To specify no parameters, or to keep all
2467
+ # the default parameter values, pass an empty Hash as a request object (see above).
2468
+ #
2469
+ # @param name [::String]
2470
+ # Required. Resource name of the membership to delete. Chat apps can delete
2471
+ # human users' or their own memberships. Chat apps can't delete other apps'
2472
+ # memberships.
2473
+ #
2474
+ # When deleting a human membership, requires the `chat.memberships` scope and
2475
+ # `spaces/{space}/members/{member}` format. You can use the email as an
2476
+ # alias for `{member}`. For example,
2477
+ # `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
2478
+ # email of the Google Chat user.
2479
+ #
2480
+ # When deleting an app membership, requires the `chat.memberships.app` scope
2481
+ # and `spaces/{space}/members/app` format.
2482
+ #
2483
+ # Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.
2484
+ # @yield [result, operation] Access the result along with the TransportOperation object
2485
+ # @yieldparam result [::Google::Apps::Chat::V1::Membership]
2486
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2487
+ #
2488
+ # @return [::Google::Apps::Chat::V1::Membership]
2489
+ #
2490
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2491
+ #
2492
+ # @example Basic example
2493
+ # require "google/apps/chat/v1"
2494
+ #
2495
+ # # Create a client object. The client can be reused for multiple calls.
2496
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2497
+ #
2498
+ # # Create a request. To set request fields, pass in keyword arguments.
2499
+ # request = Google::Apps::Chat::V1::DeleteMembershipRequest.new
2500
+ #
2501
+ # # Call the delete_membership method.
2502
+ # result = client.delete_membership request
2503
+ #
2504
+ # # The returned object is of type Google::Apps::Chat::V1::Membership.
2505
+ # p result
2506
+ #
2507
+ def delete_membership request, options = nil
2508
+ raise ::ArgumentError, "request must be provided" if request.nil?
2509
+
2510
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMembershipRequest
2511
+
2512
+ # Converts hash and nil to an options object
2513
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2514
+
2515
+ # Customize the options with defaults
2516
+ call_metadata = @config.rpcs.delete_membership.metadata.to_h
2517
+
2518
+ # Set x-goog-api-client and x-goog-user-project headers
2519
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2520
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2521
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2522
+ transports_version_send: [:rest]
2523
+
2524
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2525
+
2526
+ options.apply_defaults timeout: @config.rpcs.delete_membership.timeout,
2527
+ metadata: call_metadata,
2528
+ retry_policy: @config.rpcs.delete_membership.retry_policy
2529
+
2530
+ options.apply_defaults timeout: @config.timeout,
2531
+ metadata: @config.metadata,
2532
+ retry_policy: @config.retry_policy
2533
+
2534
+ @chat_service_stub.delete_membership request, options do |result, operation|
2535
+ yield result, operation if block_given?
2536
+ return result
2537
+ end
2538
+ rescue ::Gapic::Rest::Error => e
2539
+ raise ::Google::Cloud::Error.from_error(e)
2540
+ end
2541
+
2542
+ ##
2543
+ # Creates a reaction and adds it to a message. Only unicode emojis are
2544
+ # supported. For an example, see
2545
+ # [Add a reaction to a
2546
+ # message](https://developers.google.com/workspace/chat/create-reactions).
2547
+ # Requires [user
2548
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2549
+ #
2550
+ # @overload create_reaction(request, options = nil)
2551
+ # Pass arguments to `create_reaction` via a request object, either of type
2552
+ # {::Google::Apps::Chat::V1::CreateReactionRequest} or an equivalent Hash.
2553
+ #
2554
+ # @param request [::Google::Apps::Chat::V1::CreateReactionRequest, ::Hash]
2555
+ # A request object representing the call parameters. Required. To specify no
2556
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2557
+ # @param options [::Gapic::CallOptions, ::Hash]
2558
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2559
+ #
2560
+ # @overload create_reaction(parent: nil, reaction: nil)
2561
+ # Pass arguments to `create_reaction` via keyword arguments. Note that at
2562
+ # least one keyword argument is required. To specify no parameters, or to keep all
2563
+ # the default parameter values, pass an empty Hash as a request object (see above).
2564
+ #
2565
+ # @param parent [::String]
2566
+ # Required. The message where the reaction is created.
2567
+ #
2568
+ # Format: `spaces/{space}/messages/{message}`
2569
+ # @param reaction [::Google::Apps::Chat::V1::Reaction, ::Hash]
2570
+ # Required. The reaction to create.
2571
+ # @yield [result, operation] Access the result along with the TransportOperation object
2572
+ # @yieldparam result [::Google::Apps::Chat::V1::Reaction]
2573
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2574
+ #
2575
+ # @return [::Google::Apps::Chat::V1::Reaction]
2576
+ #
2577
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2578
+ #
2579
+ # @example Basic example
2580
+ # require "google/apps/chat/v1"
2581
+ #
2582
+ # # Create a client object. The client can be reused for multiple calls.
2583
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2584
+ #
2585
+ # # Create a request. To set request fields, pass in keyword arguments.
2586
+ # request = Google::Apps::Chat::V1::CreateReactionRequest.new
2587
+ #
2588
+ # # Call the create_reaction method.
2589
+ # result = client.create_reaction request
2590
+ #
2591
+ # # The returned object is of type Google::Apps::Chat::V1::Reaction.
2592
+ # p result
2593
+ #
2594
+ def create_reaction request, options = nil
2595
+ raise ::ArgumentError, "request must be provided" if request.nil?
2596
+
2597
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateReactionRequest
2598
+
2599
+ # Converts hash and nil to an options object
2600
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2601
+
2602
+ # Customize the options with defaults
2603
+ call_metadata = @config.rpcs.create_reaction.metadata.to_h
2604
+
2605
+ # Set x-goog-api-client and x-goog-user-project headers
2606
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2607
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2608
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2609
+ transports_version_send: [:rest]
2610
+
2611
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2612
+
2613
+ options.apply_defaults timeout: @config.rpcs.create_reaction.timeout,
2614
+ metadata: call_metadata,
2615
+ retry_policy: @config.rpcs.create_reaction.retry_policy
2616
+
2617
+ options.apply_defaults timeout: @config.timeout,
2618
+ metadata: @config.metadata,
2619
+ retry_policy: @config.retry_policy
2620
+
2621
+ @chat_service_stub.create_reaction request, options do |result, operation|
2622
+ yield result, operation if block_given?
2623
+ return result
2624
+ end
2625
+ rescue ::Gapic::Rest::Error => e
2626
+ raise ::Google::Cloud::Error.from_error(e)
2627
+ end
2628
+
2629
+ ##
2630
+ # Lists reactions to a message. For an example, see
2631
+ # [List reactions for a
2632
+ # message](https://developers.google.com/workspace/chat/list-reactions).
2633
+ # Requires [user
2634
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2635
+ #
2636
+ # @overload list_reactions(request, options = nil)
2637
+ # Pass arguments to `list_reactions` via a request object, either of type
2638
+ # {::Google::Apps::Chat::V1::ListReactionsRequest} or an equivalent Hash.
2639
+ #
2640
+ # @param request [::Google::Apps::Chat::V1::ListReactionsRequest, ::Hash]
2641
+ # A request object representing the call parameters. Required. To specify no
2642
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2643
+ # @param options [::Gapic::CallOptions, ::Hash]
2644
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2645
+ #
2646
+ # @overload list_reactions(parent: nil, page_size: nil, page_token: nil, filter: nil)
2647
+ # Pass arguments to `list_reactions` via keyword arguments. Note that at
2648
+ # least one keyword argument is required. To specify no parameters, or to keep all
2649
+ # the default parameter values, pass an empty Hash as a request object (see above).
2650
+ #
2651
+ # @param parent [::String]
2652
+ # Required. The message users reacted to.
2653
+ #
2654
+ # Format: `spaces/{space}/messages/{message}`
2655
+ # @param page_size [::Integer]
2656
+ # Optional. The maximum number of reactions returned. The service can return
2657
+ # fewer reactions than this value. If unspecified, the default value is 25.
2658
+ # The maximum value is 200; values above 200 are changed to 200.
2659
+ # @param page_token [::String]
2660
+ # Optional. (If resuming from a previous query.)
2661
+ #
2662
+ # A page token received from a previous list reactions call. Provide this
2663
+ # to retrieve the subsequent page.
2664
+ #
2665
+ # When paginating, the filter value should match the call that provided the
2666
+ # page token. Passing a different value might lead to unexpected results.
2667
+ # @param filter [::String]
2668
+ # Optional. A query filter.
2669
+ #
2670
+ # You can filter reactions by
2671
+ # [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji)
2672
+ # (either `emoji.unicode` or `emoji.custom_emoji.uid`) and
2673
+ # [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User)
2674
+ # (`user.name`).
2675
+ #
2676
+ # To filter reactions for multiple emojis or users, join similar fields
2677
+ # with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode =
2678
+ # "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`.
2679
+ #
2680
+ # To filter reactions by emoji and user, use the `AND` operator, such as
2681
+ # `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`.
2682
+ #
2683
+ # If your query uses both `AND` and `OR`, group them with parentheses.
2684
+ #
2685
+ # For example, the following queries are valid:
2686
+ #
2687
+ # ```
2688
+ # user.name = "users/\\{user}"
2689
+ # emoji.unicode = "🙂"
2690
+ # emoji.custom_emoji.uid = "\\{uid}"
2691
+ # emoji.unicode = "🙂" OR emoji.unicode = "👍"
2692
+ # emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}"
2693
+ # emoji.unicode = "🙂" AND user.name = "users/\\{user}"
2694
+ # (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}")
2695
+ # AND user.name = "users/\\{user}"
2696
+ # ```
2697
+ #
2698
+ # The following queries are invalid:
2699
+ #
2700
+ # ```
2701
+ # emoji.unicode = "🙂" AND emoji.unicode = "👍"
2702
+ # emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "\\{uid}"
2703
+ # emoji.unicode = "🙂" OR user.name = "users/\\{user}"
2704
+ # emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}" OR
2705
+ # user.name = "users/\\{user}"
2706
+ # emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "\\{uid}"
2707
+ # AND user.name = "users/\\{user}"
2708
+ # ```
2709
+ #
2710
+ # Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
2711
+ # error.
2712
+ # @yield [result, operation] Access the result along with the TransportOperation object
2713
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>]
2714
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2715
+ #
2716
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>]
2717
+ #
2718
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2719
+ #
2720
+ # @example Basic example
2721
+ # require "google/apps/chat/v1"
2722
+ #
2723
+ # # Create a client object. The client can be reused for multiple calls.
2724
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2725
+ #
2726
+ # # Create a request. To set request fields, pass in keyword arguments.
2727
+ # request = Google::Apps::Chat::V1::ListReactionsRequest.new
2728
+ #
2729
+ # # Call the list_reactions method.
2730
+ # result = client.list_reactions request
2731
+ #
2732
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2733
+ # # over elements, and API calls will be issued to fetch pages as needed.
2734
+ # result.each do |item|
2735
+ # # Each element is of type ::Google::Apps::Chat::V1::Reaction.
2736
+ # p item
2737
+ # end
2738
+ #
2739
+ def list_reactions request, options = nil
2740
+ raise ::ArgumentError, "request must be provided" if request.nil?
2741
+
2742
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListReactionsRequest
2743
+
2744
+ # Converts hash and nil to an options object
2745
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2746
+
2747
+ # Customize the options with defaults
2748
+ call_metadata = @config.rpcs.list_reactions.metadata.to_h
2749
+
2750
+ # Set x-goog-api-client and x-goog-user-project headers
2751
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2752
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2753
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2754
+ transports_version_send: [:rest]
2755
+
2756
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2757
+
2758
+ options.apply_defaults timeout: @config.rpcs.list_reactions.timeout,
2759
+ metadata: call_metadata,
2760
+ retry_policy: @config.rpcs.list_reactions.retry_policy
2761
+
2762
+ options.apply_defaults timeout: @config.timeout,
2763
+ metadata: @config.metadata,
2764
+ retry_policy: @config.retry_policy
2765
+
2766
+ @chat_service_stub.list_reactions request, options do |result, operation|
2767
+ result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_reactions, "reactions", request, result, options
2768
+ yield result, operation if block_given?
2769
+ return result
2770
+ end
2771
+ rescue ::Gapic::Rest::Error => e
2772
+ raise ::Google::Cloud::Error.from_error(e)
2773
+ end
2774
+
2775
+ ##
2776
+ # Deletes a reaction to a message. Only unicode emojis are supported.
2777
+ # For an example, see
2778
+ # [Delete a
2779
+ # reaction](https://developers.google.com/workspace/chat/delete-reactions).
2780
+ # Requires [user
2781
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2782
+ #
2783
+ # @overload delete_reaction(request, options = nil)
2784
+ # Pass arguments to `delete_reaction` via a request object, either of type
2785
+ # {::Google::Apps::Chat::V1::DeleteReactionRequest} or an equivalent Hash.
2786
+ #
2787
+ # @param request [::Google::Apps::Chat::V1::DeleteReactionRequest, ::Hash]
2788
+ # A request object representing the call parameters. Required. To specify no
2789
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2790
+ # @param options [::Gapic::CallOptions, ::Hash]
2791
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2792
+ #
2793
+ # @overload delete_reaction(name: nil)
2794
+ # Pass arguments to `delete_reaction` via keyword arguments. Note that at
2795
+ # least one keyword argument is required. To specify no parameters, or to keep all
2796
+ # the default parameter values, pass an empty Hash as a request object (see above).
2797
+ #
2798
+ # @param name [::String]
2799
+ # Required. Name of the reaction to delete.
2800
+ #
2801
+ # Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
2802
+ # @yield [result, operation] Access the result along with the TransportOperation object
2803
+ # @yieldparam result [::Google::Protobuf::Empty]
2804
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2805
+ #
2806
+ # @return [::Google::Protobuf::Empty]
2807
+ #
2808
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2809
+ #
2810
+ # @example Basic example
2811
+ # require "google/apps/chat/v1"
2812
+ #
2813
+ # # Create a client object. The client can be reused for multiple calls.
2814
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2815
+ #
2816
+ # # Create a request. To set request fields, pass in keyword arguments.
2817
+ # request = Google::Apps::Chat::V1::DeleteReactionRequest.new
2818
+ #
2819
+ # # Call the delete_reaction method.
2820
+ # result = client.delete_reaction request
2821
+ #
2822
+ # # The returned object is of type Google::Protobuf::Empty.
2823
+ # p result
2824
+ #
2825
+ def delete_reaction request, options = nil
2826
+ raise ::ArgumentError, "request must be provided" if request.nil?
2827
+
2828
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteReactionRequest
2829
+
2830
+ # Converts hash and nil to an options object
2831
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2832
+
2833
+ # Customize the options with defaults
2834
+ call_metadata = @config.rpcs.delete_reaction.metadata.to_h
2835
+
2836
+ # Set x-goog-api-client and x-goog-user-project headers
2837
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2838
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2839
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2840
+ transports_version_send: [:rest]
2841
+
2842
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2843
+
2844
+ options.apply_defaults timeout: @config.rpcs.delete_reaction.timeout,
2845
+ metadata: call_metadata,
2846
+ retry_policy: @config.rpcs.delete_reaction.retry_policy
2847
+
2848
+ options.apply_defaults timeout: @config.timeout,
2849
+ metadata: @config.metadata,
2850
+ retry_policy: @config.retry_policy
2851
+
2852
+ @chat_service_stub.delete_reaction request, options do |result, operation|
2853
+ yield result, operation if block_given?
2854
+ return result
2855
+ end
2856
+ rescue ::Gapic::Rest::Error => e
2857
+ raise ::Google::Cloud::Error.from_error(e)
2858
+ end
2859
+
2860
+ ##
2861
+ # Returns details about a user's read state within a space, used to identify
2862
+ # read and unread messages. For an example, see [Get details about a user's
2863
+ # space read
2864
+ # state](https://developers.google.com/workspace/chat/get-space-read-state).
2865
+ #
2866
+ # Requires [user
2867
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2868
+ #
2869
+ # @overload get_space_read_state(request, options = nil)
2870
+ # Pass arguments to `get_space_read_state` via a request object, either of type
2871
+ # {::Google::Apps::Chat::V1::GetSpaceReadStateRequest} or an equivalent Hash.
2872
+ #
2873
+ # @param request [::Google::Apps::Chat::V1::GetSpaceReadStateRequest, ::Hash]
2874
+ # A request object representing the call parameters. Required. To specify no
2875
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2876
+ # @param options [::Gapic::CallOptions, ::Hash]
2877
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2878
+ #
2879
+ # @overload get_space_read_state(name: nil)
2880
+ # Pass arguments to `get_space_read_state` via keyword arguments. Note that at
2881
+ # least one keyword argument is required. To specify no parameters, or to keep all
2882
+ # the default parameter values, pass an empty Hash as a request object (see above).
2883
+ #
2884
+ # @param name [::String]
2885
+ # Required. Resource name of the space read state to retrieve.
2886
+ #
2887
+ # Only supports getting read state for the calling user.
2888
+ #
2889
+ # To refer to the calling user, set one of the following:
2890
+ #
2891
+ # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
2892
+ #
2893
+ # - Their Workspace email address. For example,
2894
+ # `users/user@example.com/spaces/{space}/spaceReadState`.
2895
+ #
2896
+ # - Their user id. For example,
2897
+ # `users/123456789/spaces/{space}/spaceReadState`.
2898
+ #
2899
+ # Format: users/\\{user}/spaces/\\{space}/spaceReadState
2900
+ # @yield [result, operation] Access the result along with the TransportOperation object
2901
+ # @yieldparam result [::Google::Apps::Chat::V1::SpaceReadState]
2902
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2903
+ #
2904
+ # @return [::Google::Apps::Chat::V1::SpaceReadState]
2905
+ #
2906
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2907
+ #
2908
+ # @example Basic example
2909
+ # require "google/apps/chat/v1"
2910
+ #
2911
+ # # Create a client object. The client can be reused for multiple calls.
2912
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
2913
+ #
2914
+ # # Create a request. To set request fields, pass in keyword arguments.
2915
+ # request = Google::Apps::Chat::V1::GetSpaceReadStateRequest.new
2916
+ #
2917
+ # # Call the get_space_read_state method.
2918
+ # result = client.get_space_read_state request
2919
+ #
2920
+ # # The returned object is of type Google::Apps::Chat::V1::SpaceReadState.
2921
+ # p result
2922
+ #
2923
+ def get_space_read_state request, options = nil
2924
+ raise ::ArgumentError, "request must be provided" if request.nil?
2925
+
2926
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceReadStateRequest
2927
+
2928
+ # Converts hash and nil to an options object
2929
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2930
+
2931
+ # Customize the options with defaults
2932
+ call_metadata = @config.rpcs.get_space_read_state.metadata.to_h
2933
+
2934
+ # Set x-goog-api-client and x-goog-user-project headers
2935
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2936
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2937
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
2938
+ transports_version_send: [:rest]
2939
+
2940
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2941
+
2942
+ options.apply_defaults timeout: @config.rpcs.get_space_read_state.timeout,
2943
+ metadata: call_metadata,
2944
+ retry_policy: @config.rpcs.get_space_read_state.retry_policy
2945
+
2946
+ options.apply_defaults timeout: @config.timeout,
2947
+ metadata: @config.metadata,
2948
+ retry_policy: @config.retry_policy
2949
+
2950
+ @chat_service_stub.get_space_read_state request, options do |result, operation|
2951
+ yield result, operation if block_given?
2952
+ return result
2953
+ end
2954
+ rescue ::Gapic::Rest::Error => e
2955
+ raise ::Google::Cloud::Error.from_error(e)
2956
+ end
2957
+
2958
+ ##
2959
+ # Updates a user's read state within a space, used to identify read and
2960
+ # unread messages. For an example, see [Update a user's space read
2961
+ # state](https://developers.google.com/workspace/chat/update-space-read-state).
2962
+ #
2963
+ # Requires [user
2964
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2965
+ #
2966
+ # @overload update_space_read_state(request, options = nil)
2967
+ # Pass arguments to `update_space_read_state` via a request object, either of type
2968
+ # {::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest} or an equivalent Hash.
2969
+ #
2970
+ # @param request [::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest, ::Hash]
2971
+ # A request object representing the call parameters. Required. To specify no
2972
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2973
+ # @param options [::Gapic::CallOptions, ::Hash]
2974
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2975
+ #
2976
+ # @overload update_space_read_state(space_read_state: nil, update_mask: nil)
2977
+ # Pass arguments to `update_space_read_state` via keyword arguments. Note that at
2978
+ # least one keyword argument is required. To specify no parameters, or to keep all
2979
+ # the default parameter values, pass an empty Hash as a request object (see above).
2980
+ #
2981
+ # @param space_read_state [::Google::Apps::Chat::V1::SpaceReadState, ::Hash]
2982
+ # Required. The space read state and fields to update.
2983
+ #
2984
+ # Only supports updating read state for the calling user.
2985
+ #
2986
+ # To refer to the calling user, set one of the following:
2987
+ #
2988
+ # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
2989
+ #
2990
+ # - Their Workspace email address. For example,
2991
+ # `users/user@example.com/spaces/{space}/spaceReadState`.
2992
+ #
2993
+ # - Their user id. For example,
2994
+ # `users/123456789/spaces/{space}/spaceReadState`.
2995
+ #
2996
+ # Format: users/\\{user}/spaces/\\{space}/spaceReadState
2997
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2998
+ # Required. The field paths to update. Currently supported field paths:
2999
+ #
3000
+ # - `last_read_time`
3001
+ #
3002
+ # When the `last_read_time` is before the latest message create time, the
3003
+ # space appears as unread in the UI.
3004
+ #
3005
+ # To mark the space as read, set `last_read_time` to any value later (larger)
3006
+ # than the latest message create time. The `last_read_time` is coerced to
3007
+ # match the latest message create time. Note that the space read state only
3008
+ # affects the read state of messages that are visible in the space's
3009
+ # top-level conversation. Replies in threads are unaffected by this
3010
+ # timestamp, and instead rely on the thread read state.
3011
+ # @yield [result, operation] Access the result along with the TransportOperation object
3012
+ # @yieldparam result [::Google::Apps::Chat::V1::SpaceReadState]
3013
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3014
+ #
3015
+ # @return [::Google::Apps::Chat::V1::SpaceReadState]
3016
+ #
3017
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3018
+ #
3019
+ # @example Basic example
3020
+ # require "google/apps/chat/v1"
3021
+ #
3022
+ # # Create a client object. The client can be reused for multiple calls.
3023
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
3024
+ #
3025
+ # # Create a request. To set request fields, pass in keyword arguments.
3026
+ # request = Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new
3027
+ #
3028
+ # # Call the update_space_read_state method.
3029
+ # result = client.update_space_read_state request
3030
+ #
3031
+ # # The returned object is of type Google::Apps::Chat::V1::SpaceReadState.
3032
+ # p result
3033
+ #
3034
+ def update_space_read_state request, options = nil
3035
+ raise ::ArgumentError, "request must be provided" if request.nil?
3036
+
3037
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest
3038
+
3039
+ # Converts hash and nil to an options object
3040
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3041
+
3042
+ # Customize the options with defaults
3043
+ call_metadata = @config.rpcs.update_space_read_state.metadata.to_h
3044
+
3045
+ # Set x-goog-api-client and x-goog-user-project headers
3046
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3047
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3048
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
3049
+ transports_version_send: [:rest]
3050
+
3051
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3052
+
3053
+ options.apply_defaults timeout: @config.rpcs.update_space_read_state.timeout,
3054
+ metadata: call_metadata,
3055
+ retry_policy: @config.rpcs.update_space_read_state.retry_policy
3056
+
3057
+ options.apply_defaults timeout: @config.timeout,
3058
+ metadata: @config.metadata,
3059
+ retry_policy: @config.retry_policy
3060
+
3061
+ @chat_service_stub.update_space_read_state request, options do |result, operation|
3062
+ yield result, operation if block_given?
3063
+ return result
3064
+ end
3065
+ rescue ::Gapic::Rest::Error => e
3066
+ raise ::Google::Cloud::Error.from_error(e)
3067
+ end
3068
+
3069
+ ##
3070
+ # Returns details about a user's read state within a thread, used to identify
3071
+ # read and unread messages. For an example, see [Get details about a user's
3072
+ # thread read
3073
+ # state](https://developers.google.com/workspace/chat/get-thread-read-state).
3074
+ #
3075
+ # Requires [user
3076
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
3077
+ #
3078
+ # @overload get_thread_read_state(request, options = nil)
3079
+ # Pass arguments to `get_thread_read_state` via a request object, either of type
3080
+ # {::Google::Apps::Chat::V1::GetThreadReadStateRequest} or an equivalent Hash.
3081
+ #
3082
+ # @param request [::Google::Apps::Chat::V1::GetThreadReadStateRequest, ::Hash]
3083
+ # A request object representing the call parameters. Required. To specify no
3084
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3085
+ # @param options [::Gapic::CallOptions, ::Hash]
3086
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3087
+ #
3088
+ # @overload get_thread_read_state(name: nil)
3089
+ # Pass arguments to `get_thread_read_state` via keyword arguments. Note that at
3090
+ # least one keyword argument is required. To specify no parameters, or to keep all
3091
+ # the default parameter values, pass an empty Hash as a request object (see above).
3092
+ #
3093
+ # @param name [::String]
3094
+ # Required. Resource name of the thread read state to retrieve.
3095
+ #
3096
+ # Only supports getting read state for the calling user.
3097
+ #
3098
+ # To refer to the calling user, set one of the following:
3099
+ #
3100
+ # - The `me` alias. For example,
3101
+ # `users/me/spaces/{space}/threads/{thread}/threadReadState`.
3102
+ #
3103
+ # - Their Workspace email address. For example,
3104
+ # `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`.
3105
+ #
3106
+ # - Their user id. For example,
3107
+ # `users/123456789/spaces/{space}/threads/{thread}/threadReadState`.
3108
+ #
3109
+ # Format: users/\\{user}/spaces/\\{space}/threads/\\{thread}/threadReadState
3110
+ # @yield [result, operation] Access the result along with the TransportOperation object
3111
+ # @yieldparam result [::Google::Apps::Chat::V1::ThreadReadState]
3112
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3113
+ #
3114
+ # @return [::Google::Apps::Chat::V1::ThreadReadState]
3115
+ #
3116
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3117
+ #
3118
+ # @example Basic example
3119
+ # require "google/apps/chat/v1"
3120
+ #
3121
+ # # Create a client object. The client can be reused for multiple calls.
3122
+ # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
3123
+ #
3124
+ # # Create a request. To set request fields, pass in keyword arguments.
3125
+ # request = Google::Apps::Chat::V1::GetThreadReadStateRequest.new
3126
+ #
3127
+ # # Call the get_thread_read_state method.
3128
+ # result = client.get_thread_read_state request
3129
+ #
3130
+ # # The returned object is of type Google::Apps::Chat::V1::ThreadReadState.
3131
+ # p result
3132
+ #
3133
+ def get_thread_read_state request, options = nil
3134
+ raise ::ArgumentError, "request must be provided" if request.nil?
3135
+
3136
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetThreadReadStateRequest
3137
+
3138
+ # Converts hash and nil to an options object
3139
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3140
+
3141
+ # Customize the options with defaults
3142
+ call_metadata = @config.rpcs.get_thread_read_state.metadata.to_h
3143
+
3144
+ # Set x-goog-api-client and x-goog-user-project headers
3145
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3146
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3147
+ gapic_version: ::Google::Apps::Chat::V1::VERSION,
3148
+ transports_version_send: [:rest]
3149
+
3150
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3151
+
3152
+ options.apply_defaults timeout: @config.rpcs.get_thread_read_state.timeout,
3153
+ metadata: call_metadata,
3154
+ retry_policy: @config.rpcs.get_thread_read_state.retry_policy
3155
+
3156
+ options.apply_defaults timeout: @config.timeout,
3157
+ metadata: @config.metadata,
3158
+ retry_policy: @config.retry_policy
3159
+
3160
+ @chat_service_stub.get_thread_read_state request, options do |result, operation|
3161
+ yield result, operation if block_given?
3162
+ return result
3163
+ end
3164
+ rescue ::Gapic::Rest::Error => e
3165
+ raise ::Google::Cloud::Error.from_error(e)
3166
+ end
3167
+
3168
+ ##
3169
+ # Configuration class for the ChatService REST API.
3170
+ #
3171
+ # This class represents the configuration for ChatService REST,
3172
+ # providing control over timeouts, retry behavior, logging, transport
3173
+ # parameters, and other low-level controls. Certain parameters can also be
3174
+ # applied individually to specific RPCs. See
3175
+ # {::Google::Apps::Chat::V1::ChatService::Rest::Client::Configuration::Rpcs}
3176
+ # for a list of RPCs that can be configured independently.
3177
+ #
3178
+ # Configuration can be applied globally to all clients, or to a single client
3179
+ # on construction.
3180
+ #
3181
+ # @example
3182
+ #
3183
+ # # Modify the global config, setting the timeout for
3184
+ # # create_message to 20 seconds,
3185
+ # # and all remaining timeouts to 10 seconds.
3186
+ # ::Google::Apps::Chat::V1::ChatService::Rest::Client.configure do |config|
3187
+ # config.timeout = 10.0
3188
+ # config.rpcs.create_message.timeout = 20.0
3189
+ # end
3190
+ #
3191
+ # # Apply the above configuration only to a new client.
3192
+ # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config|
3193
+ # config.timeout = 10.0
3194
+ # config.rpcs.create_message.timeout = 20.0
3195
+ # end
3196
+ #
3197
+ # @!attribute [rw] endpoint
3198
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3199
+ # nil, indicating to use the default endpoint in the current universe domain.
3200
+ # @return [::String,nil]
3201
+ # @!attribute [rw] credentials
3202
+ # Credentials to send with calls. You may provide any of the following types:
3203
+ # * (`String`) The path to a service account key file in JSON format
3204
+ # * (`Hash`) A service account key as a Hash
3205
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3206
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3207
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3208
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3209
+ # * (`nil`) indicating no credentials
3210
+ # @return [::Object]
3211
+ # @!attribute [rw] scope
3212
+ # The OAuth scopes
3213
+ # @return [::Array<::String>]
3214
+ # @!attribute [rw] lib_name
3215
+ # The library name as recorded in instrumentation and logging
3216
+ # @return [::String]
3217
+ # @!attribute [rw] lib_version
3218
+ # The library version as recorded in instrumentation and logging
3219
+ # @return [::String]
3220
+ # @!attribute [rw] timeout
3221
+ # The call timeout in seconds.
3222
+ # @return [::Numeric]
3223
+ # @!attribute [rw] metadata
3224
+ # Additional headers to be sent with the call.
3225
+ # @return [::Hash{::Symbol=>::String}]
3226
+ # @!attribute [rw] retry_policy
3227
+ # The retry policy. The value is a hash with the following keys:
3228
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3229
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3230
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3231
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3232
+ # trigger a retry.
3233
+ # @return [::Hash]
3234
+ # @!attribute [rw] quota_project
3235
+ # A separate project against which to charge quota.
3236
+ # @return [::String]
3237
+ # @!attribute [rw] universe_domain
3238
+ # The universe domain within which to make requests. This determines the
3239
+ # default endpoint URL. The default value of nil uses the environment
3240
+ # universe (usually the default "googleapis.com" universe).
3241
+ # @return [::String,nil]
3242
+ #
3243
+ class Configuration
3244
+ extend ::Gapic::Config
3245
+
3246
+ # @private
3247
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
3248
+ DEFAULT_ENDPOINT = "chat.googleapis.com"
3249
+
3250
+ config_attr :endpoint, nil, ::String, nil
3251
+ config_attr :credentials, nil do |value|
3252
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3253
+ allowed.any? { |klass| klass === value }
3254
+ end
3255
+ config_attr :scope, nil, ::String, ::Array, nil
3256
+ config_attr :lib_name, nil, ::String, nil
3257
+ config_attr :lib_version, nil, ::String, nil
3258
+ config_attr :timeout, nil, ::Numeric, nil
3259
+ config_attr :metadata, nil, ::Hash, nil
3260
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3261
+ config_attr :quota_project, nil, ::String, nil
3262
+ config_attr :universe_domain, nil, ::String, nil
3263
+
3264
+ # @private
3265
+ def initialize parent_config = nil
3266
+ @parent_config = parent_config unless parent_config.nil?
3267
+
3268
+ yield self if block_given?
3269
+ end
3270
+
3271
+ ##
3272
+ # Configurations for individual RPCs
3273
+ # @return [Rpcs]
3274
+ #
3275
+ def rpcs
3276
+ @rpcs ||= begin
3277
+ parent_rpcs = nil
3278
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3279
+ Rpcs.new parent_rpcs
3280
+ end
3281
+ end
3282
+
3283
+ ##
3284
+ # Configuration RPC class for the ChatService API.
3285
+ #
3286
+ # Includes fields providing the configuration for each RPC in this service.
3287
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3288
+ # the following configuration fields:
3289
+ #
3290
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3291
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
3292
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3293
+ # include the following keys:
3294
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3295
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3296
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3297
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3298
+ # trigger a retry.
3299
+ #
3300
+ class Rpcs
3301
+ ##
3302
+ # RPC-specific configuration for `create_message`
3303
+ # @return [::Gapic::Config::Method]
3304
+ #
3305
+ attr_reader :create_message
3306
+ ##
3307
+ # RPC-specific configuration for `list_messages`
3308
+ # @return [::Gapic::Config::Method]
3309
+ #
3310
+ attr_reader :list_messages
3311
+ ##
3312
+ # RPC-specific configuration for `list_memberships`
3313
+ # @return [::Gapic::Config::Method]
3314
+ #
3315
+ attr_reader :list_memberships
3316
+ ##
3317
+ # RPC-specific configuration for `get_membership`
3318
+ # @return [::Gapic::Config::Method]
3319
+ #
3320
+ attr_reader :get_membership
3321
+ ##
3322
+ # RPC-specific configuration for `get_message`
3323
+ # @return [::Gapic::Config::Method]
3324
+ #
3325
+ attr_reader :get_message
3326
+ ##
3327
+ # RPC-specific configuration for `update_message`
3328
+ # @return [::Gapic::Config::Method]
3329
+ #
3330
+ attr_reader :update_message
3331
+ ##
3332
+ # RPC-specific configuration for `delete_message`
3333
+ # @return [::Gapic::Config::Method]
3334
+ #
3335
+ attr_reader :delete_message
3336
+ ##
3337
+ # RPC-specific configuration for `get_attachment`
3338
+ # @return [::Gapic::Config::Method]
3339
+ #
3340
+ attr_reader :get_attachment
3341
+ ##
3342
+ # RPC-specific configuration for `upload_attachment`
3343
+ # @return [::Gapic::Config::Method]
3344
+ #
3345
+ attr_reader :upload_attachment
3346
+ ##
3347
+ # RPC-specific configuration for `list_spaces`
3348
+ # @return [::Gapic::Config::Method]
3349
+ #
3350
+ attr_reader :list_spaces
3351
+ ##
3352
+ # RPC-specific configuration for `get_space`
3353
+ # @return [::Gapic::Config::Method]
3354
+ #
3355
+ attr_reader :get_space
3356
+ ##
3357
+ # RPC-specific configuration for `create_space`
3358
+ # @return [::Gapic::Config::Method]
3359
+ #
3360
+ attr_reader :create_space
3361
+ ##
3362
+ # RPC-specific configuration for `set_up_space`
3363
+ # @return [::Gapic::Config::Method]
3364
+ #
3365
+ attr_reader :set_up_space
3366
+ ##
3367
+ # RPC-specific configuration for `update_space`
3368
+ # @return [::Gapic::Config::Method]
3369
+ #
3370
+ attr_reader :update_space
3371
+ ##
3372
+ # RPC-specific configuration for `delete_space`
3373
+ # @return [::Gapic::Config::Method]
3374
+ #
3375
+ attr_reader :delete_space
3376
+ ##
3377
+ # RPC-specific configuration for `complete_import_space`
3378
+ # @return [::Gapic::Config::Method]
3379
+ #
3380
+ attr_reader :complete_import_space
3381
+ ##
3382
+ # RPC-specific configuration for `find_direct_message`
3383
+ # @return [::Gapic::Config::Method]
3384
+ #
3385
+ attr_reader :find_direct_message
3386
+ ##
3387
+ # RPC-specific configuration for `create_membership`
3388
+ # @return [::Gapic::Config::Method]
3389
+ #
3390
+ attr_reader :create_membership
3391
+ ##
3392
+ # RPC-specific configuration for `update_membership`
3393
+ # @return [::Gapic::Config::Method]
3394
+ #
3395
+ attr_reader :update_membership
3396
+ ##
3397
+ # RPC-specific configuration for `delete_membership`
3398
+ # @return [::Gapic::Config::Method]
3399
+ #
3400
+ attr_reader :delete_membership
3401
+ ##
3402
+ # RPC-specific configuration for `create_reaction`
3403
+ # @return [::Gapic::Config::Method]
3404
+ #
3405
+ attr_reader :create_reaction
3406
+ ##
3407
+ # RPC-specific configuration for `list_reactions`
3408
+ # @return [::Gapic::Config::Method]
3409
+ #
3410
+ attr_reader :list_reactions
3411
+ ##
3412
+ # RPC-specific configuration for `delete_reaction`
3413
+ # @return [::Gapic::Config::Method]
3414
+ #
3415
+ attr_reader :delete_reaction
3416
+ ##
3417
+ # RPC-specific configuration for `get_space_read_state`
3418
+ # @return [::Gapic::Config::Method]
3419
+ #
3420
+ attr_reader :get_space_read_state
3421
+ ##
3422
+ # RPC-specific configuration for `update_space_read_state`
3423
+ # @return [::Gapic::Config::Method]
3424
+ #
3425
+ attr_reader :update_space_read_state
3426
+ ##
3427
+ # RPC-specific configuration for `get_thread_read_state`
3428
+ # @return [::Gapic::Config::Method]
3429
+ #
3430
+ attr_reader :get_thread_read_state
3431
+
3432
+ # @private
3433
+ def initialize parent_rpcs = nil
3434
+ create_message_config = parent_rpcs.create_message if parent_rpcs.respond_to? :create_message
3435
+ @create_message = ::Gapic::Config::Method.new create_message_config
3436
+ list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages
3437
+ @list_messages = ::Gapic::Config::Method.new list_messages_config
3438
+ list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships
3439
+ @list_memberships = ::Gapic::Config::Method.new list_memberships_config
3440
+ get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership
3441
+ @get_membership = ::Gapic::Config::Method.new get_membership_config
3442
+ get_message_config = parent_rpcs.get_message if parent_rpcs.respond_to? :get_message
3443
+ @get_message = ::Gapic::Config::Method.new get_message_config
3444
+ update_message_config = parent_rpcs.update_message if parent_rpcs.respond_to? :update_message
3445
+ @update_message = ::Gapic::Config::Method.new update_message_config
3446
+ delete_message_config = parent_rpcs.delete_message if parent_rpcs.respond_to? :delete_message
3447
+ @delete_message = ::Gapic::Config::Method.new delete_message_config
3448
+ get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment
3449
+ @get_attachment = ::Gapic::Config::Method.new get_attachment_config
3450
+ upload_attachment_config = parent_rpcs.upload_attachment if parent_rpcs.respond_to? :upload_attachment
3451
+ @upload_attachment = ::Gapic::Config::Method.new upload_attachment_config
3452
+ list_spaces_config = parent_rpcs.list_spaces if parent_rpcs.respond_to? :list_spaces
3453
+ @list_spaces = ::Gapic::Config::Method.new list_spaces_config
3454
+ get_space_config = parent_rpcs.get_space if parent_rpcs.respond_to? :get_space
3455
+ @get_space = ::Gapic::Config::Method.new get_space_config
3456
+ create_space_config = parent_rpcs.create_space if parent_rpcs.respond_to? :create_space
3457
+ @create_space = ::Gapic::Config::Method.new create_space_config
3458
+ set_up_space_config = parent_rpcs.set_up_space if parent_rpcs.respond_to? :set_up_space
3459
+ @set_up_space = ::Gapic::Config::Method.new set_up_space_config
3460
+ update_space_config = parent_rpcs.update_space if parent_rpcs.respond_to? :update_space
3461
+ @update_space = ::Gapic::Config::Method.new update_space_config
3462
+ delete_space_config = parent_rpcs.delete_space if parent_rpcs.respond_to? :delete_space
3463
+ @delete_space = ::Gapic::Config::Method.new delete_space_config
3464
+ complete_import_space_config = parent_rpcs.complete_import_space if parent_rpcs.respond_to? :complete_import_space
3465
+ @complete_import_space = ::Gapic::Config::Method.new complete_import_space_config
3466
+ find_direct_message_config = parent_rpcs.find_direct_message if parent_rpcs.respond_to? :find_direct_message
3467
+ @find_direct_message = ::Gapic::Config::Method.new find_direct_message_config
3468
+ create_membership_config = parent_rpcs.create_membership if parent_rpcs.respond_to? :create_membership
3469
+ @create_membership = ::Gapic::Config::Method.new create_membership_config
3470
+ update_membership_config = parent_rpcs.update_membership if parent_rpcs.respond_to? :update_membership
3471
+ @update_membership = ::Gapic::Config::Method.new update_membership_config
3472
+ delete_membership_config = parent_rpcs.delete_membership if parent_rpcs.respond_to? :delete_membership
3473
+ @delete_membership = ::Gapic::Config::Method.new delete_membership_config
3474
+ create_reaction_config = parent_rpcs.create_reaction if parent_rpcs.respond_to? :create_reaction
3475
+ @create_reaction = ::Gapic::Config::Method.new create_reaction_config
3476
+ list_reactions_config = parent_rpcs.list_reactions if parent_rpcs.respond_to? :list_reactions
3477
+ @list_reactions = ::Gapic::Config::Method.new list_reactions_config
3478
+ delete_reaction_config = parent_rpcs.delete_reaction if parent_rpcs.respond_to? :delete_reaction
3479
+ @delete_reaction = ::Gapic::Config::Method.new delete_reaction_config
3480
+ get_space_read_state_config = parent_rpcs.get_space_read_state if parent_rpcs.respond_to? :get_space_read_state
3481
+ @get_space_read_state = ::Gapic::Config::Method.new get_space_read_state_config
3482
+ update_space_read_state_config = parent_rpcs.update_space_read_state if parent_rpcs.respond_to? :update_space_read_state
3483
+ @update_space_read_state = ::Gapic::Config::Method.new update_space_read_state_config
3484
+ get_thread_read_state_config = parent_rpcs.get_thread_read_state if parent_rpcs.respond_to? :get_thread_read_state
3485
+ @get_thread_read_state = ::Gapic::Config::Method.new get_thread_read_state_config
3486
+
3487
+ yield self if block_given?
3488
+ end
3489
+ end
3490
+ end
3491
+ end
3492
+ end
3493
+ end
3494
+ end
3495
+ end
3496
+ end
3497
+ end