|
21 | 21 | import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore |
22 | 22 | import proto # type: ignore |
23 | 23 |
|
| 24 | +from google.apps.chat_v1.types import audience as gc_audience |
24 | 25 | from google.apps.chat_v1.types import history_state |
25 | 26 |
|
26 | 27 | __protobuf__ = proto.module( |
@@ -428,6 +429,11 @@ class AccessSettings(proto.Message): |
428 | 429 |
|
429 | 430 | Setting the target audience requires `user |
430 | 431 | authentication <https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>`__. |
| 432 | + access_permission_settings (google.apps.chat_v1.types.Space.AccessPermissionSettings): |
| 433 | + Optional. Access permission settings for the space. |
| 434 | +
|
| 435 | + To set the target audience when creating a space, specify |
| 436 | + the ``accessSettings.audience`` field in your request. |
431 | 437 | """ |
432 | 438 |
|
433 | 439 | class AccessState(proto.Enum): |
@@ -467,6 +473,68 @@ class AccessState(proto.Enum): |
467 | 473 | proto.STRING, |
468 | 474 | number=3, |
469 | 475 | ) |
| 476 | + access_permission_settings: "Space.AccessPermissionSettings" = proto.Field( |
| 477 | + proto.MESSAGE, |
| 478 | + number=5, |
| 479 | + message="Space.AccessPermissionSettings", |
| 480 | + ) |
| 481 | + |
| 482 | + class AccessPermissionSettings(proto.Message): |
| 483 | + r"""Access permission settings for a space. |
| 484 | +
|
| 485 | + Attributes: |
| 486 | + discover_space_setting (google.apps.chat_v1.types.Space.AccessPermissionSetting): |
| 487 | + Optional. Access permission setting for |
| 488 | + discovering the space. |
| 489 | + join_space_setting (google.apps.chat_v1.types.Space.AccessPermissionSetting): |
| 490 | + Optional. Access permission setting for |
| 491 | + joining the space. |
| 492 | + """ |
| 493 | + |
| 494 | + discover_space_setting: "Space.AccessPermissionSetting" = proto.Field( |
| 495 | + proto.MESSAGE, |
| 496 | + number=1, |
| 497 | + message="Space.AccessPermissionSetting", |
| 498 | + ) |
| 499 | + join_space_setting: "Space.AccessPermissionSetting" = proto.Field( |
| 500 | + proto.MESSAGE, |
| 501 | + number=2, |
| 502 | + message="Space.AccessPermissionSetting", |
| 503 | + ) |
| 504 | + |
| 505 | + class AccessPermissionSetting(proto.Message): |
| 506 | + r"""An access permission setting. |
| 507 | +
|
| 508 | + Attributes: |
| 509 | + principals (MutableSequence[google.apps.chat_v1.types.Space.Principal]): |
| 510 | + Optional. Unordered list. Allowed principals |
| 511 | + for this permission. |
| 512 | + """ |
| 513 | + |
| 514 | + principals: MutableSequence["Space.Principal"] = proto.RepeatedField( |
| 515 | + proto.MESSAGE, |
| 516 | + number=1, |
| 517 | + message="Space.Principal", |
| 518 | + ) |
| 519 | + |
| 520 | + class Principal(proto.Message): |
| 521 | + r"""A principal representing an entity granted access. |
| 522 | +
|
| 523 | + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields |
| 524 | +
|
| 525 | + Attributes: |
| 526 | + audience (google.apps.chat_v1.types.Audience): |
| 527 | + An audience. |
| 528 | +
|
| 529 | + This field is a member of `oneof`_ ``principal_type``. |
| 530 | + """ |
| 531 | + |
| 532 | + audience: gc_audience.Audience = proto.Field( |
| 533 | + proto.MESSAGE, |
| 534 | + number=1, |
| 535 | + oneof="principal_type", |
| 536 | + message=gc_audience.Audience, |
| 537 | + ) |
470 | 538 |
|
471 | 539 | class PermissionSettings(proto.Message): |
472 | 540 | r"""`Permission |
@@ -1059,6 +1127,26 @@ class UpdateSpaceRequest(proto.Message): |
1059 | 1127 | ``access_settings.audience`` is not supported with |
1060 | 1128 | ``useAdminAccess``. |
1061 | 1129 |
|
| 1130 | + ``access_settings.access_permission_settings``: Updates the |
| 1131 | + `access permission |
| 1132 | + settings <https://support.google.com/chat/answer/11971020>`__ |
| 1133 | + of who can discover and join the space where ``spaceType`` |
| 1134 | + field is ``SPACE``. Principals allowed to join the space |
| 1135 | + must also be allowed to discover it. To update access |
| 1136 | + permission settings for a space, the authenticating user |
| 1137 | + must be a space manager or assistant manager and omit all |
| 1138 | + other field masks in the request. You can't update this |
| 1139 | + field if the space is in `import |
| 1140 | + mode <https://developers.google.com/workspace/chat/import-data-overview>`__. |
| 1141 | + To learn more, see `Make a space discoverable to specific |
| 1142 | + users <https://developers.google.com/workspace/chat/space-target-audience>`__. |
| 1143 | + ``access_settings.access_permission_settings`` is not |
| 1144 | + supported with ``useAdminAccess``. The supported field masks |
| 1145 | + include: |
| 1146 | +
|
| 1147 | + - ``access_settings.access_permission_settings.discoverSpaceSetting`` |
| 1148 | + - ``access_settings.access_permission_settings.joinSpaceSetting`` |
| 1149 | +
|
1062 | 1150 | ``permission_settings``: Supports changing the `permission |
1063 | 1151 | settings <https://support.google.com/chat/answer/13340792>`__ |
1064 | 1152 | of a space. When updating permission settings, you can only |
|
0 commit comments