Skip to content

Commit 5c8eaae

Browse files
docs: [google-apps-chat] Update doc for SetUpSpace in service ChatService to support group members (#12841)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE docs: Update doc for SetUpSpace in service ChatService to support group members docs: Update doc for `CreateMembership` in service `ChatService` to support group members docs: Update doc for field `group_member` in message `google.chat.v1.Membership` END_COMMIT_OVERRIDE PiperOrigin-RevId: 646951938 Source-Link: googleapis/googleapis@ac0973e Source-Link: googleapis/googleapis-gen@2b187e2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtY2hhdC8uT3dsQm90LnlhbWwiLCJoIjoiMmIxODdlMjlhM2QxOTA0ZDNlNTk4MWJiM2M4YjdhYjcwYTAwMjM5MyJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Victor Chudnovsky <[email protected]>
1 parent bcd061f commit 5c8eaae

File tree

7 files changed

+148
-20
lines changed

7 files changed

+148
-20
lines changed

packages/google-apps-chat/google/apps/chat_v1/services/chat_service/async_client.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,18 @@ async def set_up_space(
17851785
the space by setting the ``membership.member.name`` to
17861786
``users/[email protected]`` or ``users/123456789``.
17871787
1788+
To specify the Google groups to add, add memberships with the
1789+
appropriate ``membership.group_member.name``. To add or invite a
1790+
Google group, use ``groups/{group}``, where ``{group}`` is the
1791+
``id`` for the group from the Cloud Identity Groups API. For
1792+
example, you can use `Cloud Identity Groups lookup
1793+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
1794+
to retrieve the ID ``123456789`` for group email
1795+
``[email protected]``, then you can add the group to the space
1796+
by setting the ``membership.group_member.name`` to
1797+
``groups/123456789``. Group email is not supported, and Google
1798+
groups can only be added as members in named spaces.
1799+
17881800
For a named space or group chat, if the caller blocks, or is
17891801
blocked by some members, or doesn't have permission to add some
17901802
members, then those members aren't added to the created space.
@@ -2367,7 +2379,8 @@ async def create_membership(
23672379
authentication <https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>`__.
23682380
23692381
To specify the member to add, set the ``membership.member.name``
2370-
for the human or app member.
2382+
for the human or app member, or set the
2383+
``membership.group_member.name`` for the group member.
23712384
23722385
- To add the calling app to a space or a direct message between
23732386
two human users, use ``users/app``. Unable to add other apps
@@ -2383,6 +2396,18 @@ async def create_membership(
23832396
``membership.member.name`` to ``users/[email protected]`` or
23842397
``users/123456789``.
23852398
2399+
- To add or invite a Google group in a named space, use
2400+
``groups/{group}``, where ``{group}`` is the ``id`` for the
2401+
group from the Cloud Identity Groups API. For example, you
2402+
can use `Cloud Identity Groups lookup
2403+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
2404+
to retrieve the ID ``123456789`` for group email
2405+
``[email protected]``, then you can add or invite the group
2406+
to a named space by setting the
2407+
``membership.group_member.name`` to ``groups/123456789``.
2408+
Group email is not supported, and Google groups can only be
2409+
added as members in named spaces.
2410+
23862411
.. code-block:: python
23872412
23882413
# This snippet has been automatically generated and should be regarded as a

packages/google-apps-chat/google/apps/chat_v1/services/chat_service/client.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2297,6 +2297,18 @@ def set_up_space(
22972297
the space by setting the ``membership.member.name`` to
22982298
``users/[email protected]`` or ``users/123456789``.
22992299
2300+
To specify the Google groups to add, add memberships with the
2301+
appropriate ``membership.group_member.name``. To add or invite a
2302+
Google group, use ``groups/{group}``, where ``{group}`` is the
2303+
``id`` for the group from the Cloud Identity Groups API. For
2304+
example, you can use `Cloud Identity Groups lookup
2305+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
2306+
to retrieve the ID ``123456789`` for group email
2307+
``[email protected]``, then you can add the group to the space
2308+
by setting the ``membership.group_member.name`` to
2309+
``groups/123456789``. Group email is not supported, and Google
2310+
groups can only be added as members in named spaces.
2311+
23002312
For a named space or group chat, if the caller blocks, or is
23012313
blocked by some members, or doesn't have permission to add some
23022314
members, then those members aren't added to the created space.
@@ -2867,7 +2879,8 @@ def create_membership(
28672879
authentication <https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>`__.
28682880
28692881
To specify the member to add, set the ``membership.member.name``
2870-
for the human or app member.
2882+
for the human or app member, or set the
2883+
``membership.group_member.name`` for the group member.
28712884
28722885
- To add the calling app to a space or a direct message between
28732886
two human users, use ``users/app``. Unable to add other apps
@@ -2883,6 +2896,18 @@ def create_membership(
28832896
``membership.member.name`` to ``users/[email protected]`` or
28842897
``users/123456789``.
28852898
2899+
- To add or invite a Google group in a named space, use
2900+
``groups/{group}``, where ``{group}`` is the ``id`` for the
2901+
group from the Cloud Identity Groups API. For example, you
2902+
can use `Cloud Identity Groups lookup
2903+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
2904+
to retrieve the ID ``123456789`` for group email
2905+
``[email protected]``, then you can add or invite the group
2906+
to a named space by setting the
2907+
``membership.group_member.name`` to ``groups/123456789``.
2908+
Group email is not supported, and Google groups can only be
2909+
added as members in named spaces.
2910+
28862911
.. code-block:: python
28872912
28882913
# This snippet has been automatically generated and should be regarded as a

packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,18 @@ def set_up_space(self) -> Callable[[space_setup.SetUpSpaceRequest], space.Space]
700700
the space by setting the ``membership.member.name`` to
701701
``users/[email protected]`` or ``users/123456789``.
702702
703+
To specify the Google groups to add, add memberships with the
704+
appropriate ``membership.group_member.name``. To add or invite a
705+
Google group, use ``groups/{group}``, where ``{group}`` is the
706+
``id`` for the group from the Cloud Identity Groups API. For
707+
example, you can use `Cloud Identity Groups lookup
708+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
709+
to retrieve the ID ``123456789`` for group email
710+
``[email protected]``, then you can add the group to the space
711+
by setting the ``membership.group_member.name`` to
712+
``groups/123456789``. Group email is not supported, and Google
713+
groups can only be added as members in named spaces.
714+
703715
For a named space or group chat, if the caller blocks, or is
704716
blocked by some members, or doesn't have permission to add some
705717
members, then those members aren't added to the created space.
@@ -907,7 +919,8 @@ def create_membership(
907919
authentication <https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>`__.
908920
909921
To specify the member to add, set the ``membership.member.name``
910-
for the human or app member.
922+
for the human or app member, or set the
923+
``membership.group_member.name`` for the group member.
911924
912925
- To add the calling app to a space or a direct message between
913926
two human users, use ``users/app``. Unable to add other apps
@@ -923,6 +936,18 @@ def create_membership(
923936
``membership.member.name`` to ``users/[email protected]`` or
924937
``users/123456789``.
925938
939+
- To add or invite a Google group in a named space, use
940+
``groups/{group}``, where ``{group}`` is the ``id`` for the
941+
group from the Cloud Identity Groups API. For example, you
942+
can use `Cloud Identity Groups lookup
943+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
944+
to retrieve the ID ``123456789`` for group email
945+
``[email protected]``, then you can add or invite the group
946+
to a named space by setting the
947+
``membership.group_member.name`` to ``groups/123456789``.
948+
Group email is not supported, and Google groups can only be
949+
added as members in named spaces.
950+
926951
Returns:
927952
Callable[[~.CreateMembershipRequest],
928953
~.Membership]:

packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc_asyncio.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,18 @@ def set_up_space(
714714
the space by setting the ``membership.member.name`` to
715715
``users/[email protected]`` or ``users/123456789``.
716716
717+
To specify the Google groups to add, add memberships with the
718+
appropriate ``membership.group_member.name``. To add or invite a
719+
Google group, use ``groups/{group}``, where ``{group}`` is the
720+
``id`` for the group from the Cloud Identity Groups API. For
721+
example, you can use `Cloud Identity Groups lookup
722+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
723+
to retrieve the ID ``123456789`` for group email
724+
``[email protected]``, then you can add the group to the space
725+
by setting the ``membership.group_member.name`` to
726+
``groups/123456789``. Group email is not supported, and Google
727+
groups can only be added as members in named spaces.
728+
717729
For a named space or group chat, if the caller blocks, or is
718730
blocked by some members, or doesn't have permission to add some
719731
members, then those members aren't added to the created space.
@@ -927,7 +939,8 @@ def create_membership(
927939
authentication <https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>`__.
928940
929941
To specify the member to add, set the ``membership.member.name``
930-
for the human or app member.
942+
for the human or app member, or set the
943+
``membership.group_member.name`` for the group member.
931944
932945
- To add the calling app to a space or a direct message between
933946
two human users, use ``users/app``. Unable to add other apps
@@ -943,6 +956,18 @@ def create_membership(
943956
``membership.member.name`` to ``users/[email protected]`` or
944957
``users/123456789``.
945958
959+
- To add or invite a Google group in a named space, use
960+
``groups/{group}``, where ``{group}`` is the ``id`` for the
961+
group from the Cloud Identity Groups API. For example, you
962+
can use `Cloud Identity Groups lookup
963+
API <https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup>`__
964+
to retrieve the ID ``123456789`` for group email
965+
``[email protected]``, then you can add or invite the group
966+
to a named space by setting the
967+
``membership.group_member.name`` to ``groups/123456789``.
968+
Group email is not supported, and Google groups can only be
969+
added as members in named spaces.
970+
946971
Returns:
947972
Callable[[~.CreateMembershipRequest],
948973
Awaitable[~.Membership]]:

packages/google-apps-chat/google/apps/chat_v1/types/membership.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ class Membership(proto.Message):
7373
This field is a member of `oneof`_ ``memberType``.
7474
group_member (google.apps.chat_v1.types.Group):
7575
The Google Group the membership corresponds
76-
to. Only supports read operations. Other
77-
operations, like creating or updating a
78-
membership, aren't currently supported.
76+
to.
7977
8078
This field is a member of `oneof`_ ``memberType``.
8179
create_time (google.protobuf.timestamp_pb2.Timestamp):

packages/google-apps-chat/google/apps/chat_v1/types/space_setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ class SetUpSpaceRequest(proto.Message):
6969
Chat app with a different authenticated user
7070
returns an error.
7171
memberships (MutableSequence[google.apps.chat_v1.types.Membership]):
72-
Optional. The Google Chat users to invite to join the space.
73-
Omit the calling user, as they are added automatically.
72+
Optional. The Google Chat users or groups to invite to join
73+
the space. Omit the calling user, as they are added
74+
automatically.
7475
7576
The set currently allows up to 20 memberships (in addition
7677
to the caller).
@@ -86,6 +87,11 @@ class SetUpSpaceRequest(proto.Message):
8687
users from external Google Workspace domains, user's email
8788
must be used for ``{user}``.
8889
90+
For Google group membership, the ``Membership.group_member``
91+
field must contain a ``group`` with ``name`` populated
92+
(format ``groups/{group}``). You can only add Google groups
93+
when setting ``Space.spaceType`` to ``SPACE``.
94+
8995
Optional when setting ``Space.spaceType`` to ``SPACE``.
9096
9197
Required when setting ``Space.spaceType`` to ``GROUP_CHAT``,

packages/google-apps-chat/noxfile.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,28 @@ def install_unittest_dependencies(session, *constraints):
160160
session.install("-e", ".", *constraints)
161161

162162

163-
def default(session):
163+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
164+
@nox.parametrize(
165+
"protobuf_implementation",
166+
["python", "upb", "cpp"],
167+
)
168+
def unit(session, protobuf_implementation):
164169
# Install all test dependencies, then install this package in-place.
165170

171+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
172+
session.skip("cpp implementation is not supported in python 3.11+")
173+
166174
constraints_path = str(
167175
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
168176
)
169177
install_unittest_dependencies(session, "-c", constraints_path)
170178

179+
# TODO(https://github.com/googleapis/synthtool/issues/1976):
180+
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
181+
# The 'cpp' implementation requires Protobuf<4.
182+
if protobuf_implementation == "cpp":
183+
session.install("protobuf<4")
184+
171185
# Run py.test against the unit tests.
172186
session.run(
173187
"py.test",
@@ -181,15 +195,12 @@ def default(session):
181195
"--cov-fail-under=0",
182196
os.path.join("tests", "unit"),
183197
*session.posargs,
198+
env={
199+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
200+
},
184201
)
185202

186203

187-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
188-
def unit(session):
189-
"""Run the unit test suite."""
190-
default(session)
191-
192-
193204
def install_systemtest_dependencies(session, *constraints):
194205
# Use pre-release gRPC for system tests.
195206
# Exclude version 1.52.0rc1 which has a known issue.
@@ -358,9 +369,16 @@ def docfx(session):
358369

359370

360371
@nox.session(python="3.12")
361-
def prerelease_deps(session):
372+
@nox.parametrize(
373+
"protobuf_implementation",
374+
["python", "upb", "cpp"],
375+
)
376+
def prerelease_deps(session, protobuf_implementation):
362377
"""Run all tests with prerelease versions of dependencies installed."""
363378

379+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
380+
session.skip("cpp implementation is not supported in python 3.11+")
381+
364382
# Install all dependencies
365383
session.install("-e", ".[all, tests, tracing]")
366384
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -397,9 +415,9 @@ def prerelease_deps(session):
397415
"protobuf",
398416
# dependency of grpc
399417
"six",
418+
"grpc-google-iam-v1",
400419
"googleapis-common-protos",
401-
# Exclude version 1.52.0rc1 which has a known issue. See https://github.com/grpc/grpc/issues/32163
402-
"grpcio!=1.52.0rc1",
420+
"grpcio",
403421
"grpcio-status",
404422
"google-api-core",
405423
"google-auth",
@@ -425,4 +443,10 @@ def prerelease_deps(session):
425443
session.run("python", "-c", "import grpc; print(grpc.__version__)")
426444
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")
427445

428-
session.run("py.test", "tests/unit")
446+
session.run(
447+
"py.test",
448+
"tests/unit",
449+
env={
450+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
451+
},
452+
)

0 commit comments

Comments
 (0)