google-apps-chat-v1 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -296,8 +296,28 @@ module Google
296
296
  endpoint: @config.endpoint,
297
297
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
298
298
  universe_domain: @config.universe_domain,
299
- credentials: credentials
299
+ credentials: credentials,
300
+ logger: @config.logger
300
301
  )
302
+
303
+ @chat_service_stub.logger(stub: true)&.info do |entry|
304
+ entry.set_system_name
305
+ entry.set_service
306
+ entry.message = "Created client for #{entry.service}"
307
+ entry.set_credentials_fields credentials
308
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
309
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
310
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
311
+ end
312
+ end
313
+
314
+ ##
315
+ # The logger used for request/response debug logging.
316
+ #
317
+ # @return [Logger]
318
+ #
319
+ def logger
320
+ @chat_service_stub.logger
301
321
  end
302
322
 
303
323
  # Service calls
@@ -306,8 +326,11 @@ module Google
306
326
  # Creates a message in a Google Chat space. For an example, see [Send a
307
327
  # message](https://developers.google.com/workspace/chat/create-messages).
308
328
  #
309
- # The `create()` method requires either user or app authentication. Chat
310
- # attributes the message sender differently depending on the type of
329
+ # The `create()` method requires either [user
330
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
331
+ # or [app
332
+ # authentication](https://developers.google.com/workspace/chat/authorize-import).
333
+ # Chat attributes the message sender differently depending on the type of
311
334
  # authentication that you use in your request.
312
335
  #
313
336
  # The following image shows how Chat attributes a message when you use app
@@ -328,6 +351,12 @@ module Google
328
351
  #
329
352
  # The maximum message size, including the message contents, is 32,000 bytes.
330
353
  #
354
+ # For
355
+ # [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks)
356
+ # requests, the response doesn't contain the full message. The response only
357
+ # populates the `name` and `thread.name` fields in addition to the
358
+ # information that was in the request.
359
+ #
331
360
  # @overload create_message(request, options = nil)
332
361
  # Pass arguments to `create_message` via a request object, either of type
333
362
  # {::Google::Apps::Chat::V1::CreateMessageRequest} or an equivalent Hash.
@@ -364,6 +393,12 @@ module Google
364
393
  # @param message_reply_option [::Google::Apps::Chat::V1::CreateMessageRequest::MessageReplyOption]
365
394
  # Optional. Specifies whether a message starts a thread or replies to one.
366
395
  # Only supported in named spaces.
396
+ #
397
+ # When [responding to user
398
+ # interactions](https://developers.google.com/workspace/chat/receive-respond-interactions),
399
+ # this field is ignored. For interactions within a thread, the reply is
400
+ # created in the same thread. Otherwise, the reply is created as a new
401
+ # thread.
367
402
  # @param message_id [::String]
368
403
  # Optional. A custom ID for a message. Lets Chat apps get, update, or delete
369
404
  # a message without needing to store the system-assigned ID in the message's
@@ -433,7 +468,6 @@ module Google
433
468
 
434
469
  @chat_service_stub.create_message request, options do |result, operation|
435
470
  yield result, operation if block_given?
436
- return result
437
471
  end
438
472
  rescue ::Gapic::Rest::Error => e
439
473
  raise ::Google::Cloud::Error.from_error(e)
@@ -447,6 +481,7 @@ module Google
447
481
  # For an example, see
448
482
  # [List
449
483
  # messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list).
484
+ #
450
485
  # Requires [user
451
486
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
452
487
  #
@@ -470,8 +505,8 @@ module Google
470
505
  #
471
506
  # Format: `spaces/{space}`
472
507
  # @param page_size [::Integer]
473
- # The maximum number of messages returned. The service might return fewer
474
- # messages than this value.
508
+ # Optional. The maximum number of messages returned. The service might return
509
+ # fewer messages than this value.
475
510
  #
476
511
  # If unspecified, at most 25 are returned.
477
512
  #
@@ -480,16 +515,14 @@ module Google
480
515
  #
481
516
  # Negative values return an `INVALID_ARGUMENT` error.
482
517
  # @param page_token [::String]
483
- # Optional, if resuming from a previous query.
484
- #
485
- # A page token received from a previous list messages call. Provide this
486
- # parameter to retrieve the subsequent page.
518
+ # Optional. A page token received from a previous list messages call. Provide
519
+ # this parameter to retrieve the subsequent page.
487
520
  #
488
521
  # When paginating, all other parameters provided should match the call that
489
522
  # provided the page token. Passing different values to the other parameters
490
523
  # might lead to unexpected results.
491
524
  # @param filter [::String]
492
- # A query filter.
525
+ # Optional. A query filter.
493
526
  #
494
527
  # You can filter messages by date (`create_time`) and thread (`thread.name`).
495
528
  #
@@ -527,10 +560,8 @@ module Google
527
560
  # Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
528
561
  # error.
529
562
  # @param order_by [::String]
530
- # Optional, if resuming from a previous query.
531
- #
532
- # How the list of messages is ordered. Specify a value to order by an
533
- # ordering operation. Valid ordering operation values are as follows:
563
+ # Optional. How the list of messages is ordered. Specify a value to order by
564
+ # an ordering operation. Valid ordering operation values are as follows:
534
565
  #
535
566
  # - `ASC` for ascending.
536
567
  #
@@ -538,8 +569,9 @@ module Google
538
569
  #
539
570
  # The default ordering is `create_time ASC`.
540
571
  # @param show_deleted [::Boolean]
541
- # Whether to include deleted messages. Deleted messages include deleted time
542
- # and metadata about their deletion, but message content is unavailable.
572
+ # Optional. Whether to include deleted messages. Deleted messages include
573
+ # deleted time and metadata about their deletion, but message content is
574
+ # unavailable.
543
575
  # @yield [result, operation] Access the result along with the TransportOperation object
544
576
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>]
545
577
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -598,7 +630,7 @@ module Google
598
630
  @chat_service_stub.list_messages request, options do |result, operation|
599
631
  result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_messages, "messages", request, result, options
600
632
  yield result, operation if block_given?
601
- return result
633
+ throw :response, result
602
634
  end
603
635
  rescue ::Gapic::Rest::Error => e
604
636
  raise ::Google::Cloud::Error.from_error(e)
@@ -617,13 +649,16 @@ module Google
617
649
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
618
650
  # lists memberships in spaces that the authenticated user has access to.
619
651
  #
620
- # Requires
621
- # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
622
- # Supports
623
- # [app
652
+ # Supports the following types of
653
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
654
+ #
655
+ # - [App
624
656
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
625
- # and [user
626
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
657
+ #
658
+ # - [User
659
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
660
+ # You can authenticate and authorize this method with administrator
661
+ # privileges by setting the `use_admin_access` field in the request.
627
662
  #
628
663
  # @overload list_memberships(request, options = nil)
629
664
  # Pass arguments to `list_memberships` via a request object, either of type
@@ -718,7 +753,7 @@ module Google
718
753
  # Currently requires [user
719
754
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
720
755
  # @param use_admin_access [::Boolean]
721
- # When `true`, the method runs using the user's Google Workspace
756
+ # Optional. When `true`, the method runs using the user's Google Workspace
722
757
  # administrator privileges.
723
758
  #
724
759
  # The calling user must be a Google Workspace administrator with the
@@ -788,7 +823,7 @@ module Google
788
823
  @chat_service_stub.list_memberships request, options do |result, operation|
789
824
  result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_memberships, "memberships", request, result, options
790
825
  yield result, operation if block_given?
791
- return result
826
+ throw :response, result
792
827
  end
793
828
  rescue ::Gapic::Rest::Error => e
794
829
  raise ::Google::Cloud::Error.from_error(e)
@@ -799,13 +834,16 @@ module Google
799
834
  # [Get details about a user's or Google Chat app's
800
835
  # membership](https://developers.google.com/workspace/chat/get-members).
801
836
  #
802
- # Requires
803
- # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
804
- # Supports
805
- # [app
837
+ # Supports the following types of
838
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
839
+ #
840
+ # - [App
806
841
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
807
- # and [user
808
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
842
+ #
843
+ # - [User
844
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
845
+ # You can authenticate and authorize this method with administrator
846
+ # privileges by setting the `use_admin_access` field in the request.
809
847
  #
810
848
  # @overload get_membership(request, options = nil)
811
849
  # Pass arguments to `get_membership` via a request object, either of type
@@ -831,13 +869,11 @@ module Google
831
869
  #
832
870
  # Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
833
871
  #
834
- # When [authenticated as a
835
- # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
836
- # you can use the user's email as an alias for `{member}`. For example,
872
+ # You can use the user's email as an alias for `{member}`. For example,
837
873
  # `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
838
874
  # email of the Google Chat user.
839
875
  # @param use_admin_access [::Boolean]
840
- # When `true`, the method runs using the user's Google Workspace
876
+ # Optional. When `true`, the method runs using the user's Google Workspace
841
877
  # administrator privileges.
842
878
  #
843
879
  # The calling user must be a Google Workspace administrator with the
@@ -902,7 +938,6 @@ module Google
902
938
 
903
939
  @chat_service_stub.get_membership request, options do |result, operation|
904
940
  yield result, operation if block_given?
905
- return result
906
941
  end
907
942
  rescue ::Gapic::Rest::Error => e
908
943
  raise ::Google::Cloud::Error.from_error(e)
@@ -913,13 +948,14 @@ module Google
913
948
  # For an example, see [Get details about a
914
949
  # message](https://developers.google.com/workspace/chat/get-messages).
915
950
  #
916
- # Requires
917
- # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
918
- # Supports
919
- # [app
951
+ # Supports the following types of
952
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
953
+ #
954
+ # - [App
920
955
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
921
- # and [user
922
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
956
+ #
957
+ # - [User
958
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
923
959
  #
924
960
  # Note: Might return a message from a blocked member or space.
925
961
  #
@@ -1000,7 +1036,6 @@ module Google
1000
1036
 
1001
1037
  @chat_service_stub.get_message request, options do |result, operation|
1002
1038
  yield result, operation if block_given?
1003
- return result
1004
1039
  end
1005
1040
  rescue ::Gapic::Rest::Error => e
1006
1041
  raise ::Google::Cloud::Error.from_error(e)
@@ -1014,13 +1049,15 @@ module Google
1014
1049
  # [Update a
1015
1050
  # message](https://developers.google.com/workspace/chat/update-messages).
1016
1051
  #
1017
- # Requires
1018
- # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
1019
- # Supports
1020
- # [app
1052
+ # Supports the following types of
1053
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
1054
+ #
1055
+ # - [App
1021
1056
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1022
- # and [user
1023
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1057
+ #
1058
+ # - [User
1059
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1060
+ #
1024
1061
  # When using app authentication, requests can only update messages
1025
1062
  # created by the calling Chat app.
1026
1063
  #
@@ -1117,7 +1154,6 @@ module Google
1117
1154
 
1118
1155
  @chat_service_stub.update_message request, options do |result, operation|
1119
1156
  yield result, operation if block_given?
1120
- return result
1121
1157
  end
1122
1158
  rescue ::Gapic::Rest::Error => e
1123
1159
  raise ::Google::Cloud::Error.from_error(e)
@@ -1128,13 +1164,15 @@ module Google
1128
1164
  # For an example, see [Delete a
1129
1165
  # message](https://developers.google.com/workspace/chat/delete-messages).
1130
1166
  #
1131
- # Requires
1132
- # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
1133
- # Supports
1134
- # [app
1167
+ # Supports the following types of
1168
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
1169
+ #
1170
+ # - [App
1135
1171
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1136
- # and [user
1137
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1172
+ #
1173
+ # - [User
1174
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1175
+ #
1138
1176
  # When using app authentication, requests can only delete messages
1139
1177
  # created by the calling Chat app.
1140
1178
  #
@@ -1163,8 +1201,8 @@ module Google
1163
1201
  # message]
1164
1202
  # (https://developers.google.com/workspace/chat/create-messages#name_a_created_message).
1165
1203
  # @param force [::Boolean]
1166
- # When `true`, deleting a message also deletes its threaded replies. When
1167
- # `false`, if a message has threaded replies, deletion fails.
1204
+ # Optional. When `true`, deleting a message also deletes its threaded
1205
+ # replies. When `false`, if a message has threaded replies, deletion fails.
1168
1206
  #
1169
1207
  # Only applies when [authenticating as a
1170
1208
  # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
@@ -1223,7 +1261,6 @@ module Google
1223
1261
 
1224
1262
  @chat_service_stub.delete_message request, options do |result, operation|
1225
1263
  yield result, operation if block_given?
1226
- return result
1227
1264
  end
1228
1265
  rescue ::Gapic::Rest::Error => e
1229
1266
  raise ::Google::Cloud::Error.from_error(e)
@@ -1310,7 +1347,6 @@ module Google
1310
1347
 
1311
1348
  @chat_service_stub.get_attachment request, options do |result, operation|
1312
1349
  yield result, operation if block_given?
1313
- return result
1314
1350
  end
1315
1351
  rescue ::Gapic::Rest::Error => e
1316
1352
  raise ::Google::Cloud::Error.from_error(e)
@@ -1320,6 +1356,7 @@ module Google
1320
1356
  # Uploads an attachment. For an example, see
1321
1357
  # [Upload media as a file
1322
1358
  # attachment](https://developers.google.com/workspace/chat/upload-media-attachments).
1359
+ #
1323
1360
  # Requires user
1324
1361
  # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1325
1362
  #
@@ -1400,7 +1437,6 @@ module Google
1400
1437
 
1401
1438
  @chat_service_stub.upload_attachment request, options do |result, operation|
1402
1439
  yield result, operation if block_given?
1403
- return result
1404
1440
  end
1405
1441
  rescue ::Gapic::Rest::Error => e
1406
1442
  raise ::Google::Cloud::Error.from_error(e)
@@ -1412,16 +1448,14 @@ module Google
1412
1448
  # [List
1413
1449
  # spaces](https://developers.google.com/workspace/chat/list-spaces).
1414
1450
  #
1415
- # Requires
1416
- # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
1417
- # Supports
1418
- # [app
1451
+ # Supports the following types of
1452
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
1453
+ #
1454
+ # - [App
1419
1455
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1420
- # and [user
1421
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1422
1456
  #
1423
- # Lists spaces visible to the caller or authenticated user. Group chats
1424
- # and DMs aren't listed until the first message is sent.
1457
+ # - [User
1458
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1425
1459
  #
1426
1460
  # To list all named spaces by Google Workspace organization, use the
1427
1461
  # [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search)
@@ -1536,7 +1570,7 @@ module Google
1536
1570
  @chat_service_stub.list_spaces request, options do |result, operation|
1537
1571
  result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_spaces, "spaces", request, result, options
1538
1572
  yield result, operation if block_given?
1539
- return result
1573
+ throw :response, result
1540
1574
  end
1541
1575
  rescue ::Gapic::Rest::Error => e
1542
1576
  raise ::Google::Cloud::Error.from_error(e)
@@ -1544,7 +1578,9 @@ module Google
1544
1578
 
1545
1579
  ##
1546
1580
  # Returns a list of spaces in a Google Workspace organization based on an
1547
- # administrator's search. Requires [user
1581
+ # administrator's search.
1582
+ #
1583
+ # Requires [user
1548
1584
  # authentication with administrator
1549
1585
  # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges).
1550
1586
  # In the request, set `use_admin_access` to `true`.
@@ -1745,7 +1781,7 @@ module Google
1745
1781
  @chat_service_stub.search_spaces request, options do |result, operation|
1746
1782
  result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :search_spaces, "spaces", request, result, options
1747
1783
  yield result, operation if block_given?
1748
- return result
1784
+ throw :response, result
1749
1785
  end
1750
1786
  rescue ::Gapic::Rest::Error => e
1751
1787
  raise ::Google::Cloud::Error.from_error(e)
@@ -1756,13 +1792,16 @@ module Google
1756
1792
  # [Get details about a
1757
1793
  # space](https://developers.google.com/workspace/chat/get-spaces).
1758
1794
  #
1759
- # Requires
1760
- # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
1761
- # Supports
1762
- # [app
1795
+ # Supports the following types of
1796
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
1797
+ #
1798
+ # - [App
1763
1799
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1764
- # and [user
1765
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1800
+ #
1801
+ # - [User
1802
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1803
+ # You can authenticate and authorize this method with administrator
1804
+ # privileges by setting the `use_admin_access` field in the request.
1766
1805
  #
1767
1806
  # @overload get_space(request, options = nil)
1768
1807
  # Pass arguments to `get_space` via a request object, either of type
@@ -1784,7 +1823,7 @@ module Google
1784
1823
  #
1785
1824
  # Format: `spaces/{space}`
1786
1825
  # @param use_admin_access [::Boolean]
1787
- # When `true`, the method runs using the user's Google Workspace
1826
+ # Optional. When `true`, the method runs using the user's Google Workspace
1788
1827
  # administrator privileges.
1789
1828
  #
1790
1829
  # The calling user must be a Google Workspace administrator with the
@@ -1846,28 +1885,33 @@ module Google
1846
1885
 
1847
1886
  @chat_service_stub.get_space request, options do |result, operation|
1848
1887
  yield result, operation if block_given?
1849
- return result
1850
1888
  end
1851
1889
  rescue ::Gapic::Rest::Error => e
1852
1890
  raise ::Google::Cloud::Error.from_error(e)
1853
1891
  end
1854
1892
 
1855
1893
  ##
1856
- # Creates a space with no members. Can be used to create a named space.
1857
- # Spaces grouped by topics aren't supported. For an example, see
1858
- # [Create a
1894
+ # Creates a space with no members. Can be used to create a named space, or a
1895
+ # group chat in `Import mode`. For an example, see [Create a
1859
1896
  # space](https://developers.google.com/workspace/chat/create-spaces).
1860
1897
  #
1861
1898
  # If you receive the error message `ALREADY_EXISTS` when creating
1862
1899
  # a space, try a different `displayName`. An existing space within
1863
1900
  # the Google Workspace organization might already use this display name.
1864
1901
  #
1865
- # If you're a member of the [Developer Preview
1866
- # program](https://developers.google.com/workspace/preview), you can create a
1867
- # group chat in import mode using `spaceType.GROUP_CHAT`.
1902
+ # Supports the following types of
1903
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
1868
1904
  #
1869
- # Requires [user
1870
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
1905
+ # - [App
1906
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
1907
+ # with [administrator approval](https://support.google.com/a?p=chat-app-auth)
1908
+ # in [Developer Preview](https://developers.google.com/workspace/preview)
1909
+ #
1910
+ # - [User
1911
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
1912
+ #
1913
+ # When authenticating as an app, the `space.customer` field must be set in
1914
+ # the request.
1871
1915
  #
1872
1916
  # @overload create_space(request, options = nil)
1873
1917
  # Pass arguments to `create_space` via a request object, either of type
@@ -1886,15 +1930,13 @@ module Google
1886
1930
  #
1887
1931
  # @param space [::Google::Apps::Chat::V1::Space, ::Hash]
1888
1932
  # Required. The `displayName` and `spaceType` fields must be populated. Only
1889
- # `SpaceType.SPACE` is supported.
1933
+ # `SpaceType.SPACE` and `SpaceType.GROUP_CHAT` are supported.
1934
+ # `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true.
1890
1935
  #
1891
1936
  # If you receive the error message `ALREADY_EXISTS`,
1892
1937
  # try a different `displayName`. An existing space within the Google
1893
1938
  # Workspace organization might already use this display name.
1894
1939
  #
1895
- # If you're a member of the [Developer Preview
1896
- # program](https://developers.google.com/workspace/preview),
1897
- # `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true.
1898
1940
  #
1899
1941
  # The space `name` is assigned on the server so anything specified in this
1900
1942
  # field will be ignored.
@@ -1958,7 +2000,6 @@ module Google
1958
2000
 
1959
2001
  @chat_service_stub.create_space request, options do |result, operation|
1960
2002
  yield result, operation if block_given?
1961
- return result
1962
2003
  end
1963
2004
  rescue ::Gapic::Rest::Error => e
1964
2005
  raise ::Google::Cloud::Error.from_error(e)
@@ -2147,7 +2188,6 @@ module Google
2147
2188
 
2148
2189
  @chat_service_stub.set_up_space request, options do |result, operation|
2149
2190
  yield result, operation if block_given?
2150
- return result
2151
2191
  end
2152
2192
  rescue ::Gapic::Rest::Error => e
2153
2193
  raise ::Google::Cloud::Error.from_error(e)
@@ -2162,8 +2202,18 @@ module Google
2162
2202
  # `ALREADY_EXISTS`, try a different display name.. An existing space within
2163
2203
  # the Google Workspace organization might already use this display name.
2164
2204
  #
2165
- # Requires [user
2166
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2205
+ # Supports the following types of
2206
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
2207
+ #
2208
+ # - [App
2209
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
2210
+ # with [administrator approval](https://support.google.com/a?p=chat-app-auth)
2211
+ # in [Developer Preview](https://developers.google.com/workspace/preview)
2212
+ #
2213
+ # - [User
2214
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2215
+ # You can authenticate and authorize this method with administrator
2216
+ # privileges by setting the `use_admin_access` field in the request.
2167
2217
  #
2168
2218
  # @overload update_space(request, options = nil)
2169
2219
  # Pass arguments to `update_space` via a request object, either of type
@@ -2247,7 +2297,7 @@ module Google
2247
2297
  # - `permission_settings.manageWebhooks`
2248
2298
  # - `permission_settings.replyMessages`
2249
2299
  # @param use_admin_access [::Boolean]
2250
- # When `true`, the method runs using the user's Google Workspace
2300
+ # Optional. When `true`, the method runs using the user's Google Workspace
2251
2301
  # administrator privileges.
2252
2302
  #
2253
2303
  # The calling user must be a Google Workspace administrator with the
@@ -2312,7 +2362,6 @@ module Google
2312
2362
 
2313
2363
  @chat_service_stub.update_space request, options do |result, operation|
2314
2364
  yield result, operation if block_given?
2315
- return result
2316
2365
  end
2317
2366
  rescue ::Gapic::Rest::Error => e
2318
2367
  raise ::Google::Cloud::Error.from_error(e)
@@ -2324,9 +2373,19 @@ module Google
2324
2373
  # memberships in the space—are also deleted. For an example, see
2325
2374
  # [Delete a
2326
2375
  # space](https://developers.google.com/workspace/chat/delete-spaces).
2327
- # Requires [user
2376
+ #
2377
+ # Supports the following types of
2378
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
2379
+ #
2380
+ # - [App
2381
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
2382
+ # with [administrator approval](https://support.google.com/a?p=chat-app-auth)
2383
+ # in [Developer Preview](https://developers.google.com/workspace/preview)
2384
+ #
2385
+ # - [User
2328
2386
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2329
- # from a user who has permission to delete the space.
2387
+ # You can authenticate and authorize this method with administrator
2388
+ # privileges by setting the `use_admin_access` field in the request.
2330
2389
  #
2331
2390
  # @overload delete_space(request, options = nil)
2332
2391
  # Pass arguments to `delete_space` via a request object, either of type
@@ -2348,7 +2407,7 @@ module Google
2348
2407
  #
2349
2408
  # Format: `spaces/{space}`
2350
2409
  # @param use_admin_access [::Boolean]
2351
- # When `true`, the method runs using the user's Google Workspace
2410
+ # Optional. When `true`, the method runs using the user's Google Workspace
2352
2411
  # administrator privileges.
2353
2412
  #
2354
2413
  # The calling user must be a Google Workspace administrator with the
@@ -2410,7 +2469,6 @@ module Google
2410
2469
 
2411
2470
  @chat_service_stub.delete_space request, options do |result, operation|
2412
2471
  yield result, operation if block_given?
2413
- return result
2414
2472
  end
2415
2473
  rescue ::Gapic::Rest::Error => e
2416
2474
  raise ::Google::Cloud::Error.from_error(e)
@@ -2420,8 +2478,11 @@ module Google
2420
2478
  # Completes the
2421
2479
  # [import process](https://developers.google.com/workspace/chat/import-data)
2422
2480
  # for the specified space and makes it visible to users.
2423
- # Requires app authentication and domain-wide delegation. For more
2424
- # information, see [Authorize Google Chat apps to import
2481
+ #
2482
+ # Requires [app
2483
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
2484
+ # and domain-wide delegation. For more information, see [Authorize Google
2485
+ # Chat apps to import
2425
2486
  # data](https://developers.google.com/workspace/chat/authorize-import).
2426
2487
  #
2427
2488
  # @overload complete_import_space(request, options = nil)
@@ -2496,7 +2557,6 @@ module Google
2496
2557
 
2497
2558
  @chat_service_stub.complete_import_space request, options do |result, operation|
2498
2559
  yield result, operation if block_given?
2499
- return result
2500
2560
  end
2501
2561
  rescue ::Gapic::Rest::Error => e
2502
2562
  raise ::Google::Cloud::Error.from_error(e)
@@ -2508,20 +2568,24 @@ module Google
2508
2568
  # see
2509
2569
  # [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
2510
2570
  #
2571
+ # With [app
2572
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
2573
+ # returns the direct message space between the specified user and the calling
2574
+ # Chat app.
2575
+ #
2511
2576
  # With [user
2512
2577
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
2513
2578
  # returns the direct message space between the specified user and the
2514
2579
  # authenticated user.
2515
2580
  #
2516
- # With [app
2517
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
2518
- # returns the direct message space between the specified user and the calling
2519
- # Chat app.
2581
+ # // Supports the following types of
2582
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
2520
2583
  #
2521
- # Requires [user
2584
+ # - [App
2585
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
2586
+ #
2587
+ # - [User
2522
2588
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2523
- # or [app
2524
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
2525
2589
  #
2526
2590
  # @overload find_direct_message(request, options = nil)
2527
2591
  # Pass arguments to `find_direct_message` via a request object, either of type
@@ -2605,7 +2669,6 @@ module Google
2605
2669
 
2606
2670
  @chat_service_stub.find_direct_message request, options do |result, operation|
2607
2671
  yield result, operation if block_given?
2608
- return result
2609
2672
  end
2610
2673
  rescue ::Gapic::Rest::Error => e
2611
2674
  raise ::Google::Cloud::Error.from_error(e)
@@ -2618,8 +2681,19 @@ module Google
2618
2681
  # policy turned off, then they're invited, and must accept the space
2619
2682
  # invitation before joining. Otherwise, creating a membership adds the member
2620
2683
  # directly to the specified space.
2621
- # Requires [user
2622
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2684
+ #
2685
+ # Supports the following types of
2686
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
2687
+ #
2688
+ # - [App
2689
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
2690
+ # with [administrator approval](https://support.google.com/a?p=chat-app-auth)
2691
+ # in [Developer Preview](https://developers.google.com/workspace/preview)
2692
+ #
2693
+ # - [User
2694
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2695
+ # You can authenticate and authorize this method with administrator
2696
+ # privileges by setting the `use_admin_access` field in the request.
2623
2697
  #
2624
2698
  # For example usage, see:
2625
2699
  #
@@ -2654,23 +2728,44 @@ module Google
2654
2728
  # Format: spaces/\\{space}
2655
2729
  # @param membership [::Google::Apps::Chat::V1::Membership, ::Hash]
2656
2730
  # Required. The membership relation to create.
2731
+ #
2657
2732
  # The `memberType` field must contain a user with the `user.name` and
2658
2733
  # `user.type` fields populated. The server will assign a resource name
2659
2734
  # and overwrite anything specified.
2735
+ #
2660
2736
  # When a Chat app creates a membership relation for a human user, it must use
2661
- # the `chat.memberships` scope, set `user.type` to `HUMAN`, and set
2662
- # `user.name` with format `users/{user}`, where `{user}` can be the email
2663
- # address for the user. For users in the same Workspace organization `{user}`
2664
- # can also be the `id` of the
2665
- # [person](https://developers.google.com/people/api/rest/v1/people) from the
2666
- # People API, or the `id` for the user in the Directory API. For example, if
2667
- # the People API Person profile ID for `user@example.com` is `123456789`, you
2668
- # can add the user to the space by setting the `membership.member.name` to
2669
- # `users/user@example.com` or `users/123456789`. When a Chat app creates a
2670
- # membership relation for itself, it must use the `chat.memberships.app`
2671
- # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`.
2737
+ # certain authorization scopes and set specific values for certain fields:
2738
+ #
2739
+ # - When [authenticating as a
2740
+ # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
2741
+ # the `chat.memberships` authorization scope is required.
2742
+ #
2743
+ # - When [authenticating as an
2744
+ # app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
2745
+ # the `chat.app.memberships` authorization scope is required.
2746
+ # Authenticating as an app is available in [Developer
2747
+ # Preview](https://developers.google.com/workspace/preview).
2748
+ #
2749
+ # - Set `user.type` to `HUMAN`, and set `user.name` with format
2750
+ # `users/{user}`, where `{user}` can be the email address for the user. For
2751
+ # users in the same Workspace organization `{user}` can also be the `id` of
2752
+ # the [person](https://developers.google.com/people/api/rest/v1/people) from
2753
+ # the People API, or the `id` for the user in the Directory API. For example,
2754
+ # if the People API Person profile ID for `user@example.com` is `123456789`,
2755
+ # you can add the user to the space by setting the `membership.member.name`
2756
+ # to `users/user@example.com` or `users/123456789`.
2757
+ #
2758
+ # Inviting users external to the Workspace organization that owns the space
2759
+ # requires [user
2760
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2761
+ #
2762
+ # When a Chat app creates a membership relation for itself, it must
2763
+ # [authenticate as a
2764
+ # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2765
+ # and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set
2766
+ # `user.name` to `users/app`.
2672
2767
  # @param use_admin_access [::Boolean]
2673
- # When `true`, the method runs using the user's Google Workspace
2768
+ # Optional. When `true`, the method runs using the user's Google Workspace
2674
2769
  # administrator privileges.
2675
2770
  #
2676
2771
  # The calling user must be a Google Workspace administrator with the
@@ -2736,7 +2831,6 @@ module Google
2736
2831
 
2737
2832
  @chat_service_stub.create_membership request, options do |result, operation|
2738
2833
  yield result, operation if block_given?
2739
- return result
2740
2834
  end
2741
2835
  rescue ::Gapic::Rest::Error => e
2742
2836
  raise ::Google::Cloud::Error.from_error(e)
@@ -2746,8 +2840,18 @@ module Google
2746
2840
  # Updates a membership. For an example, see [Update a user's membership in
2747
2841
  # a space](https://developers.google.com/workspace/chat/update-members).
2748
2842
  #
2749
- # Requires [user
2750
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2843
+ # Supports the following types of
2844
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
2845
+ #
2846
+ # - [App
2847
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
2848
+ # with [administrator approval](https://support.google.com/a?p=chat-app-auth)
2849
+ # in [Developer Preview](https://developers.google.com/workspace/preview)
2850
+ #
2851
+ # - [User
2852
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2853
+ # You can authenticate and authorize this method with administrator
2854
+ # privileges by setting the `use_admin_access` field in the request.
2751
2855
  #
2752
2856
  # @overload update_membership(request, options = nil)
2753
2857
  # Pass arguments to `update_membership` via a request object, either of type
@@ -2775,7 +2879,7 @@ module Google
2775
2879
  #
2776
2880
  # - `role`
2777
2881
  # @param use_admin_access [::Boolean]
2778
- # When `true`, the method runs using the user's Google Workspace
2882
+ # Optional. When `true`, the method runs using the user's Google Workspace
2779
2883
  # administrator privileges.
2780
2884
  #
2781
2885
  # The calling user must be a Google Workspace administrator with the
@@ -2837,7 +2941,6 @@ module Google
2837
2941
 
2838
2942
  @chat_service_stub.update_membership request, options do |result, operation|
2839
2943
  yield result, operation if block_given?
2840
- return result
2841
2944
  end
2842
2945
  rescue ::Gapic::Rest::Error => e
2843
2946
  raise ::Google::Cloud::Error.from_error(e)
@@ -2848,8 +2951,18 @@ module Google
2848
2951
  # [Remove a user or a Google Chat app from a
2849
2952
  # space](https://developers.google.com/workspace/chat/delete-members).
2850
2953
  #
2851
- # Requires [user
2852
- # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2954
+ # Supports the following types of
2955
+ # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
2956
+ #
2957
+ # - [App
2958
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
2959
+ # with [administrator approval](https://support.google.com/a?p=chat-app-auth)
2960
+ # in [Developer Preview](https://developers.google.com/workspace/preview)
2961
+ #
2962
+ # - [User
2963
+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
2964
+ # You can authenticate and authorize this method with administrator
2965
+ # privileges by setting the `use_admin_access` field in the request.
2853
2966
  #
2854
2967
  # @overload delete_membership(request, options = nil)
2855
2968
  # Pass arguments to `delete_membership` via a request object, either of type
@@ -2882,7 +2995,7 @@ module Google
2882
2995
  #
2883
2996
  # Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.
2884
2997
  # @param use_admin_access [::Boolean]
2885
- # When `true`, the method runs using the user's Google Workspace
2998
+ # Optional. When `true`, the method runs using the user's Google Workspace
2886
2999
  # administrator privileges.
2887
3000
  #
2888
3001
  # The calling user must be a Google Workspace administrator with the
@@ -2946,7 +3059,6 @@ module Google
2946
3059
 
2947
3060
  @chat_service_stub.delete_membership request, options do |result, operation|
2948
3061
  yield result, operation if block_given?
2949
- return result
2950
3062
  end
2951
3063
  rescue ::Gapic::Rest::Error => e
2952
3064
  raise ::Google::Cloud::Error.from_error(e)
@@ -2957,6 +3069,7 @@ module Google
2957
3069
  # supported. For an example, see
2958
3070
  # [Add a reaction to a
2959
3071
  # message](https://developers.google.com/workspace/chat/create-reactions).
3072
+ #
2960
3073
  # Requires [user
2961
3074
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
2962
3075
  #
@@ -3034,7 +3147,6 @@ module Google
3034
3147
 
3035
3148
  @chat_service_stub.create_reaction request, options do |result, operation|
3036
3149
  yield result, operation if block_given?
3037
- return result
3038
3150
  end
3039
3151
  rescue ::Gapic::Rest::Error => e
3040
3152
  raise ::Google::Cloud::Error.from_error(e)
@@ -3044,6 +3156,7 @@ module Google
3044
3156
  # Lists reactions to a message. For an example, see
3045
3157
  # [List reactions for a
3046
3158
  # message](https://developers.google.com/workspace/chat/list-reactions).
3159
+ #
3047
3160
  # Requires [user
3048
3161
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
3049
3162
  #
@@ -3181,7 +3294,7 @@ module Google
3181
3294
  @chat_service_stub.list_reactions request, options do |result, operation|
3182
3295
  result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_reactions, "reactions", request, result, options
3183
3296
  yield result, operation if block_given?
3184
- return result
3297
+ throw :response, result
3185
3298
  end
3186
3299
  rescue ::Gapic::Rest::Error => e
3187
3300
  raise ::Google::Cloud::Error.from_error(e)
@@ -3192,6 +3305,7 @@ module Google
3192
3305
  # For an example, see
3193
3306
  # [Delete a
3194
3307
  # reaction](https://developers.google.com/workspace/chat/delete-reactions).
3308
+ #
3195
3309
  # Requires [user
3196
3310
  # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
3197
3311
  #
@@ -3267,7 +3381,6 @@ module Google
3267
3381
 
3268
3382
  @chat_service_stub.delete_reaction request, options do |result, operation|
3269
3383
  yield result, operation if block_given?
3270
- return result
3271
3384
  end
3272
3385
  rescue ::Gapic::Rest::Error => e
3273
3386
  raise ::Google::Cloud::Error.from_error(e)
@@ -3366,7 +3479,6 @@ module Google
3366
3479
 
3367
3480
  @chat_service_stub.get_space_read_state request, options do |result, operation|
3368
3481
  yield result, operation if block_given?
3369
- return result
3370
3482
  end
3371
3483
  rescue ::Gapic::Rest::Error => e
3372
3484
  raise ::Google::Cloud::Error.from_error(e)
@@ -3478,7 +3590,6 @@ module Google
3478
3590
 
3479
3591
  @chat_service_stub.update_space_read_state request, options do |result, operation|
3480
3592
  yield result, operation if block_given?
3481
- return result
3482
3593
  end
3483
3594
  rescue ::Gapic::Rest::Error => e
3484
3595
  raise ::Google::Cloud::Error.from_error(e)
@@ -3578,7 +3689,6 @@ module Google
3578
3689
 
3579
3690
  @chat_service_stub.get_thread_read_state request, options do |result, operation|
3580
3691
  yield result, operation if block_given?
3581
- return result
3582
3692
  end
3583
3693
  rescue ::Gapic::Rest::Error => e
3584
3694
  raise ::Google::Cloud::Error.from_error(e)
@@ -3675,7 +3785,6 @@ module Google
3675
3785
 
3676
3786
  @chat_service_stub.get_space_event request, options do |result, operation|
3677
3787
  yield result, operation if block_given?
3678
- return result
3679
3788
  end
3680
3789
  rescue ::Gapic::Rest::Error => e
3681
3790
  raise ::Google::Cloud::Error.from_error(e)
@@ -3724,8 +3833,8 @@ module Google
3724
3833
  #
3725
3834
  # Negative values return an `INVALID_ARGUMENT` error.
3726
3835
  # @param page_token [::String]
3727
- # A page token, received from a previous list space events call. Provide this
3728
- # to retrieve the subsequent page.
3836
+ # Optional. A page token, received from a previous list space events call.
3837
+ # Provide this to retrieve the subsequent page.
3729
3838
  #
3730
3839
  # When paginating, all other parameters provided to list space events must
3731
3840
  # match the call that provided the page token. Passing different values to
@@ -3841,7 +3950,7 @@ module Google
3841
3950
  @chat_service_stub.list_space_events request, options do |result, operation|
3842
3951
  result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_space_events, "space_events", request, result, options
3843
3952
  yield result, operation if block_given?
3844
- return result
3953
+ throw :response, result
3845
3954
  end
3846
3955
  rescue ::Gapic::Rest::Error => e
3847
3956
  raise ::Google::Cloud::Error.from_error(e)
@@ -3921,6 +4030,11 @@ module Google
3921
4030
  # default endpoint URL. The default value of nil uses the environment
3922
4031
  # universe (usually the default "googleapis.com" universe).
3923
4032
  # @return [::String,nil]
4033
+ # @!attribute [rw] logger
4034
+ # A custom logger to use for request/response debug logging, or the value
4035
+ # `:default` (the default) to construct a default logger, or `nil` to
4036
+ # explicitly disable logging.
4037
+ # @return [::Logger,:default,nil]
3924
4038
  #
3925
4039
  class Configuration
3926
4040
  extend ::Gapic::Config
@@ -3942,6 +4056,7 @@ module Google
3942
4056
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3943
4057
  config_attr :quota_project, nil, ::String, nil
3944
4058
  config_attr :universe_domain, nil, ::String, nil
4059
+ config_attr :logger, :default, ::Logger, nil, :default
3945
4060
 
3946
4061
  # @private
3947
4062
  def initialize parent_config = nil