Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions librarian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ version: v0.26.0
repo: googleapis/google-cloud-python
sources:
googleapis:
commit: 99f54e6513f09d8df1707a6c553b0a3c6ef9b5fb
sha256: 7cee15fe1ae76a16aaf70425c4380a3a0fcbfeb4ea8e30c934c43f5cd54b9657
commit: fe04226e3d76435acbfd3ffb51f6771740e1fb5b
sha256: e99c641a9c5525394de43c762b9db50c3ada1f219d6dbdba594ae992fbe1d838
default:
output: packages
tag_format: '{name}-v{version}'
Expand Down
2 changes: 2 additions & 0 deletions packages/google-apps-chat/google/apps/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
UploadAttachmentRequest,
UploadAttachmentResponse,
)
from google.apps.chat_v1.types.audience import Audience
from google.apps.chat_v1.types.availability import (
Availability,
CustomStatus,
Expand Down Expand Up @@ -199,6 +200,7 @@
"GetAttachmentRequest",
"UploadAttachmentRequest",
"UploadAttachmentResponse",
"Audience",
"Availability",
"CustomStatus",
"DoNotDisturbMetadata",
Expand Down
2 changes: 2 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
UploadAttachmentRequest,
UploadAttachmentResponse,
)
from .types.audience import Audience
from .types.availability import (
Availability,
CustomStatus,
Expand Down Expand Up @@ -271,6 +272,7 @@ def _get_version(dependency_name):
"AttachedGif",
"Attachment",
"AttachmentDataRef",
"Audience",
"Availability",
"CalendarEventLinkData",
"CardWithId",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,27 @@ async def sample_update_space():
``access_settings.audience`` is not supported with
``useAdminAccess``.

``access_settings.access_permission_settings``: Updates
the `access permission
settings <https://support.google.com/chat/answer/11971020>`__
of who can discover and join the space where
``spaceType`` field is ``SPACE``. Principals allowed to
join the space must also be allowed to discover it. To
update access permission settings for a space, the
authenticating user must be a space manager or assistant
manager and omit all other field masks in the request.
You can't update this field if the space is in `import
mode <https://developers.google.com/workspace/chat/import-data-overview>`__.
To learn more, see `Make a space discoverable to
specific
users <https://developers.google.com/workspace/chat/space-target-audience>`__.
``access_settings.access_permission_settings`` is not
supported with ``useAdminAccess``. The supported field
masks include:

- ``access_settings.access_permission_settings.discoverSpaceSetting``
- ``access_settings.access_permission_settings.joinSpaceSetting``

``permission_settings``: Supports changing the
`permission
settings <https://support.google.com/chat/answer/13340792>`__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3161,6 +3161,27 @@ def sample_update_space():
``access_settings.audience`` is not supported with
``useAdminAccess``.

``access_settings.access_permission_settings``: Updates
the `access permission
settings <https://support.google.com/chat/answer/11971020>`__
of who can discover and join the space where
``spaceType`` field is ``SPACE``. Principals allowed to
join the space must also be allowed to discover it. To
update access permission settings for a space, the
authenticating user must be a space manager or assistant
manager and omit all other field masks in the request.
You can't update this field if the space is in `import
mode <https://developers.google.com/workspace/chat/import-data-overview>`__.
To learn more, see `Make a space discoverable to
specific
users <https://developers.google.com/workspace/chat/space-target-audience>`__.
``access_settings.access_permission_settings`` is not
supported with ``useAdminAccess``. The supported field
masks include:

- ``access_settings.access_permission_settings.discoverSpaceSetting``
- ``access_settings.access_permission_settings.joinSpaceSetting``

``permission_settings``: Supports changing the
`permission
settings <https://support.google.com/chat/answer/13340792>`__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
UploadAttachmentRequest,
UploadAttachmentResponse,
)
from .audience import (
Audience,
)
from .availability import (
Availability,
CustomStatus,
Expand Down Expand Up @@ -208,6 +211,7 @@
"GetAttachmentRequest",
"UploadAttachmentRequest",
"UploadAttachmentResponse",
"Audience",
"Availability",
"CustomStatus",
"DoNotDisturbMetadata",
Expand Down
61 changes: 61 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/types/audience.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import MutableMapping, MutableSequence

import proto # type: ignore

__protobuf__ = proto.module(
package="google.chat.v1",
manifest={
"Audience",
},
)


class Audience(proto.Message):
r"""A target audience in Google Chat. A target audience represents a
group of users within a Google Workspace organization, defined by an
administrator. Target audiences are used to configure access and
visibility settings for resources, such as making a space
discoverable to a specific group of users.

For more details, see `Target
audiences <https://support.google.com/a/answer/9934697>`__ and `Make
a space discoverable to a target
audience <https://developers.google.com/workspace/chat/space-target-audience>`__.

Attributes:
name (str):
The resource name of the `target
audience <https://support.google.com/a/answer/9934697>`__
who can discover or join the space. For details, see `Make a
space discoverable to a target
audience <https://developers.google.com/workspace/chat/space-target-audience>`__.
Format: ``audiences/{audience}``

To use the default target audience for the Google Workspace
organization, set to ``audiences/default``.
"""

name: str = proto.Field(
proto.STRING,
number=1,
)


__all__ = tuple(sorted(__protobuf__.manifest))
88 changes: 88 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/types/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
import proto # type: ignore

from google.apps.chat_v1.types import audience as gc_audience
from google.apps.chat_v1.types import history_state

__protobuf__ = proto.module(
Expand Down Expand Up @@ -428,6 +429,11 @@ class AccessSettings(proto.Message):
Setting the target audience requires `user
authentication <https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>`__.
access_permission_settings (google.apps.chat_v1.types.Space.AccessPermissionSettings):
Optional. Access permission settings for the space.
To set the target audience when creating a space, specify
the ``accessSettings.audience`` field in your request.
"""

class AccessState(proto.Enum):
Expand Down Expand Up @@ -467,6 +473,68 @@ class AccessState(proto.Enum):
proto.STRING,
number=3,
)
access_permission_settings: "Space.AccessPermissionSettings" = proto.Field(
proto.MESSAGE,
number=5,
message="Space.AccessPermissionSettings",
)

class AccessPermissionSettings(proto.Message):
r"""Access permission settings for a space.
Attributes:
discover_space_setting (google.apps.chat_v1.types.Space.AccessPermissionSetting):
Optional. Access permission setting for
discovering the space.
join_space_setting (google.apps.chat_v1.types.Space.AccessPermissionSetting):
Optional. Access permission setting for
joining the space.
"""

discover_space_setting: "Space.AccessPermissionSetting" = proto.Field(
proto.MESSAGE,
number=1,
message="Space.AccessPermissionSetting",
)
join_space_setting: "Space.AccessPermissionSetting" = proto.Field(
proto.MESSAGE,
number=2,
message="Space.AccessPermissionSetting",
)

class AccessPermissionSetting(proto.Message):
r"""An access permission setting.
Attributes:
principals (MutableSequence[google.apps.chat_v1.types.Space.Principal]):
Optional. Unordered list. Allowed principals
for this permission.
"""

principals: MutableSequence["Space.Principal"] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message="Space.Principal",
)

class Principal(proto.Message):
r"""A principal representing an entity granted access.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
audience (google.apps.chat_v1.types.Audience):
An audience.
This field is a member of `oneof`_ ``principal_type``.
"""

audience: gc_audience.Audience = proto.Field(
proto.MESSAGE,
number=1,
oneof="principal_type",
message=gc_audience.Audience,
)

class PermissionSettings(proto.Message):
r"""`Permission
Expand Down Expand Up @@ -1059,6 +1127,26 @@ class UpdateSpaceRequest(proto.Message):
``access_settings.audience`` is not supported with
``useAdminAccess``.
``access_settings.access_permission_settings``: Updates the
`access permission
settings <https://support.google.com/chat/answer/11971020>`__
of who can discover and join the space where ``spaceType``
field is ``SPACE``. Principals allowed to join the space
must also be allowed to discover it. To update access
permission settings for a space, the authenticating user
must be a space manager or assistant manager and omit all
other field masks in the request. You can't update this
field if the space is in `import
mode <https://developers.google.com/workspace/chat/import-data-overview>`__.
To learn more, see `Make a space discoverable to specific
users <https://developers.google.com/workspace/chat/space-target-audience>`__.
``access_settings.access_permission_settings`` is not
supported with ``useAdminAccess``. The supported field masks
include:
- ``access_settings.access_permission_settings.discoverSpaceSetting``
- ``access_settings.access_permission_settings.joinSpaceSetting``
``permission_settings``: Supports changing the `permission
settings <https://support.google.com/chat/answer/13340792>`__
of a space. When updating permission settings, you can only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
action_status,
annotation,
attachment,
audience,
availability,
contextual_addon,
deletion_metadata,
Expand Down Expand Up @@ -29848,7 +29849,16 @@ def test_create_message_rest_call_success(request_type):
"joined_direct_human_user_count": 3185,
"joined_group_count": 1933,
},
"access_settings": {"access_state": 1, "audience": "audience_value"},
"access_settings": {
"access_state": 1,
"audience": "audience_value",
"access_permission_settings": {
"discover_space_setting": {
"principals": [{"audience": {"name": "name_value"}}]
},
"join_space_setting": {},
},
},
"customer": "customer_value",
"space_uri": "space_uri_value",
"predefined_permission_settings": 1,
Expand Down Expand Up @@ -31071,7 +31081,16 @@ def test_update_message_rest_call_success(request_type):
"joined_direct_human_user_count": 3185,
"joined_group_count": 1933,
},
"access_settings": {"access_state": 1, "audience": "audience_value"},
"access_settings": {
"access_state": 1,
"audience": "audience_value",
"access_permission_settings": {
"discover_space_setting": {
"principals": [{"audience": {"name": "name_value"}}]
},
"join_space_setting": {},
},
},
"customer": "customer_value",
"space_uri": "space_uri_value",
"predefined_permission_settings": 1,
Expand Down Expand Up @@ -32168,7 +32187,16 @@ def test_create_space_rest_call_success(request_type):
"joined_direct_human_user_count": 3185,
"joined_group_count": 1933,
},
"access_settings": {"access_state": 1, "audience": "audience_value"},
"access_settings": {
"access_state": 1,
"audience": "audience_value",
"access_permission_settings": {
"discover_space_setting": {
"principals": [{"audience": {"name": "name_value"}}]
},
"join_space_setting": {},
},
},
"customer": "customer_value",
"space_uri": "space_uri_value",
"predefined_permission_settings": 1,
Expand Down Expand Up @@ -32585,7 +32613,16 @@ def test_update_space_rest_call_success(request_type):
"joined_direct_human_user_count": 3185,
"joined_group_count": 1933,
},
"access_settings": {"access_state": 1, "audience": "audience_value"},
"access_settings": {
"access_state": 1,
"audience": "audience_value",
"access_permission_settings": {
"discover_space_setting": {
"principals": [{"audience": {"name": "name_value"}}]
},
"join_space_setting": {},
},
},
"customer": "customer_value",
"space_uri": "space_uri_value",
"predefined_permission_settings": 1,
Expand Down
Loading
Loading