Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [google-apps-chat] Add doc for Discoverable Space support for GA launch #12859

Merged
merged 2 commits into from
Jul 3, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.7" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.7" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ async def sample_get_attachment():
The request object. Request to get an attachment.
name (:class:`str`):
Required. Resource name of the attachment, in the form
``spaces/*/messages/*/attachments/*``.
``spaces/{space}/messages/{message}/attachments/{attachment}``.

This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -1443,6 +1443,11 @@ async def list_spaces(
Lists spaces visible to the caller or authenticated user. Group
chats and DMs aren't listed until the first message is sent.

To list all named spaces by Google Workspace organization, use
the
```spaces.search()`` <https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search>`__
method using Workspace administrator privileges instead.

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
Expand Down Expand Up @@ -1574,7 +1579,7 @@ async def sample_get_space():
The request object. A request to return a single space.
name (:class:`str`):
Required. Resource name of the space, in the form
`spaces/*`.
``spaces/{space}``.

Format: ``spaces/{space}``

Expand Down Expand Up @@ -1982,6 +1987,7 @@ async def sample_update_space():
name is optional if the existing space already has
the ``SPACE`` type. Trying to update the space type
in other ways results in an invalid argument error).
``space_type`` is not supported with admin access.

- ``space_details``

Expand All @@ -1992,15 +1998,33 @@ async def sample_update_space():
history
setting <https://support.google.com/a/answer/7664184>`__.
Warning: mutually exclusive with all other field
paths.)
paths.) ``space_history_state`` is not supported with
admin access.

- Developer Preview: ``access_settings.audience``
(Supports changing the `access
- ``access_settings.audience`` (Supports changing the
`access
setting <https://support.google.com/chat/answer/11971020>`__
of a space. If no audience is specified in the access
setting, the space's access setting is updated to
restricted. Warning: mutually exclusive with all
other field paths.)
of who can discover the space, join the space, and
preview the messages in space. If no audience is
specified in the access setting, the space's access
setting is updated to private. Warning: mutually
exclusive with all other field paths.)
``access_settings.audience`` is not supported with
admin access.

- Developer Preview: Supports changing the `permission
settings <https://support.google.com/chat/answer/13340792>`__
of a space, supported field paths include:
``permission_settings.manage_members_and_groups``,
``permission_settings.modify_space_details``,
``permission_settings.toggle_history``,
``permission_settings.use_at_mention_all``,
``permission_settings.manage_apps``,
``permission_settings.manage_webhooks``,
``permission_settings.reply_messages`` (Warning:
mutually exclusive with all other non-permission
settings field paths). ``permission_settings`` is not
supported with admin access.

This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@ def sample_get_attachment():
The request object. Request to get an attachment.
name (str):
Required. Resource name of the attachment, in the form
``spaces/*/messages/*/attachments/*``.
``spaces/{space}/messages/{message}/attachments/{attachment}``.

This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -1963,6 +1963,11 @@ def list_spaces(
Lists spaces visible to the caller or authenticated user. Group
chats and DMs aren't listed until the first message is sent.

To list all named spaces by Google Workspace organization, use
the
```spaces.search()`` <https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search>`__
method using Workspace administrator privileges instead.

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
Expand Down Expand Up @@ -2092,7 +2097,7 @@ def sample_get_space():
The request object. A request to return a single space.
name (str):
Required. Resource name of the space, in the form
`spaces/*`.
``spaces/{space}``.

Format: ``spaces/{space}``

Expand Down Expand Up @@ -2492,6 +2497,7 @@ def sample_update_space():
name is optional if the existing space already has
the ``SPACE`` type. Trying to update the space type
in other ways results in an invalid argument error).
``space_type`` is not supported with admin access.

- ``space_details``

Expand All @@ -2502,15 +2508,33 @@ def sample_update_space():
history
setting <https://support.google.com/a/answer/7664184>`__.
Warning: mutually exclusive with all other field
paths.)
paths.) ``space_history_state`` is not supported with
admin access.

- Developer Preview: ``access_settings.audience``
(Supports changing the `access
- ``access_settings.audience`` (Supports changing the
`access
setting <https://support.google.com/chat/answer/11971020>`__
of a space. If no audience is specified in the access
setting, the space's access setting is updated to
restricted. Warning: mutually exclusive with all
other field paths.)
of who can discover the space, join the space, and
preview the messages in space. If no audience is
specified in the access setting, the space's access
setting is updated to private. Warning: mutually
exclusive with all other field paths.)
``access_settings.audience`` is not supported with
admin access.

- Developer Preview: Supports changing the `permission
settings <https://support.google.com/chat/answer/13340792>`__
of a space, supported field paths include:
``permission_settings.manage_members_and_groups``,
``permission_settings.modify_space_details``,
``permission_settings.toggle_history``,
``permission_settings.use_at_mention_all``,
``permission_settings.manage_apps``,
``permission_settings.manage_webhooks``,
``permission_settings.reply_messages`` (Warning:
mutually exclusive with all other non-permission
settings field paths). ``permission_settings`` is not
supported with admin access.

This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class ChatServiceTransport(abc.ABC):
"""Abstract transport class for ChatService."""

AUTH_SCOPES = (
"https://www.googleapis.com/auth/chat.admin.delete",
"https://www.googleapis.com/auth/chat.admin.memberships",
"https://www.googleapis.com/auth/chat.admin.memberships.readonly",
"https://www.googleapis.com/auth/chat.admin.spaces",
"https://www.googleapis.com/auth/chat.admin.spaces.readonly",
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.delete",
"https://www.googleapis.com/auth/chat.import",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@ def list_spaces(
Lists spaces visible to the caller or authenticated user. Group
chats and DMs aren't listed until the first message is sent.

To list all named spaces by Google Workspace organization, use
the
```spaces.search()`` <https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search>`__
method using Workspace administrator privileges instead.

Returns:
Callable[[~.ListSpacesRequest],
~.ListSpacesResponse]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,11 @@ def list_spaces(
Lists spaces visible to the caller or authenticated user. Group
chats and DMs aren't listed until the first message is sent.

To list all named spaces by Google Workspace organization, use
the
```spaces.search()`` <https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search>`__
method using Workspace administrator privileges instead.

Returns:
Callable[[~.ListSpacesRequest],
Awaitable[~.ListSpacesResponse]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Attachment(proto.Message):
Attributes:
name (str):
Resource name of the attachment, in the form
``spaces/*/messages/*/attachments/*``.
``spaces/{space}/messages/{message}/attachments/{attachment}``.
content_name (str):
Output only. The original file name for the
content, not the full path.
Expand Down Expand Up @@ -178,7 +178,7 @@ class GetAttachmentRequest(proto.Message):
Attributes:
name (str):
Required. Resource name of the attachment, in the form
``spaces/*/messages/*/attachments/*``.
``spaces/{space}/messages/{message}/attachments/{attachment}``.
"""

name: str = proto.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,18 +289,25 @@ class ListMembershipsRequest(proto.Message):
``ROLE_MANAGER``.

To filter by type, set ``member.type`` to ``HUMAN`` or
``BOT``.
``BOT``. Developer Preview: You can also filter for
``member.type`` using the ``!=`` operator.

To filter by both role and type, use the ``AND`` operator.
To filter by either role or type, use the ``OR`` operator.

Either ``member.type = "HUMAN"`` or ``member.type != "BOT"``
is required when ``use_admin_access`` is set to true. Other
member type filters will be rejected.

For example, the following queries are valid:

::

role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
member.type = "HUMAN" AND role = "ROLE_MANAGER"

member.type != "BOT"

The following queries are invalid:

::
Expand Down
105 changes: 97 additions & 8 deletions packages/google-apps-chat/google/apps/chat_v1/types/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ class Space(proto.Message):

To support admin install, your Chat app must
feature direct messaging.
access_settings (google.apps.chat_v1.types.Space.AccessSettings):
Optional. Specifies the `access
setting <https://support.google.com/chat/answer/11971020>`__
of the space. Only populated when the ``space_type`` is
``SPACE``.
space_uri (str):
Output only. The URI for a user to access the
space.
"""

class Type(proto.Enum):
Expand Down Expand Up @@ -220,6 +228,58 @@ class SpaceDetails(proto.Message):
number=2,
)

class AccessSettings(proto.Message):
r"""Represents the `access
setting <https://support.google.com/chat/answer/11971020>`__ of the
space.

Attributes:
access_state (google.apps.chat_v1.types.Space.AccessSettings.AccessState):
Output only. Indicates the access state of
the space.
audience (str):
Optional. The resource name of the `target
audience <https://support.google.com/a/answer/9934697>`__
who can discover the space, join the space, and preview the
messages in 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``.
"""

class AccessState(proto.Enum):
r"""Represents the access state of the space.

Values:
ACCESS_STATE_UNSPECIFIED (0):
Access state is unknown or not supported in
this API.
PRIVATE (1):
Space is discoverable by added or invited
members or groups.
DISCOVERABLE (2):
Space is discoverable by the selected `target
audience <https://support.google.com/a/answer/9934697>`__,
as well as added or invited members or groups.
"""
ACCESS_STATE_UNSPECIFIED = 0
PRIVATE = 1
DISCOVERABLE = 2

access_state: "Space.AccessSettings.AccessState" = proto.Field(
proto.ENUM,
number=1,
enum="Space.AccessSettings.AccessState",
)
audience: str = proto.Field(
proto.STRING,
number=3,
)

name: str = proto.Field(
proto.STRING,
number=1,
Expand Down Expand Up @@ -278,6 +338,15 @@ class SpaceDetails(proto.Message):
proto.BOOL,
number=19,
)
access_settings: AccessSettings = proto.Field(
proto.MESSAGE,
number=23,
message=AccessSettings,
)
space_uri: str = proto.Field(
proto.STRING,
number=25,
)


class CreateSpaceRequest(proto.Message):
Expand Down Expand Up @@ -408,7 +477,7 @@ class GetSpaceRequest(proto.Message):
Attributes:
name (str):
Required. Resource name of the space, in the form
`spaces/*`.
``spaces/{space}``.

Format: ``spaces/{space}``
"""
Expand Down Expand Up @@ -484,7 +553,8 @@ class UpdateSpaceRequest(proto.Message):
specified space when updating the display name is
optional if the existing space already has the ``SPACE``
type. Trying to update the space type in other ways
results in an invalid argument error).
results in an invalid argument error). ``space_type`` is
not supported with admin access.

- ``space_details``

Expand All @@ -494,14 +564,33 @@ class UpdateSpaceRequest(proto.Message):
if `the organization allows users to change their history
setting <https://support.google.com/a/answer/7664184>`__.
Warning: mutually exclusive with all other field paths.)
``space_history_state`` is not supported with admin
access.

- Developer Preview: ``access_settings.audience`` (Supports
changing the `access
- ``access_settings.audience`` (Supports changing the
`access
setting <https://support.google.com/chat/answer/11971020>`__
of a space. If no audience is specified in the access
setting, the space's access setting is updated to
restricted. Warning: mutually exclusive with all other
field paths.)
of who can discover the space, join the space, and
preview the messages in space. If no audience is
specified in the access setting, the space's access
setting is updated to private. Warning: mutually
exclusive with all other field paths.)
``access_settings.audience`` is not supported with admin
access.

- Developer Preview: Supports changing the `permission
settings <https://support.google.com/chat/answer/13340792>`__
of a space, supported field paths include:
``permission_settings.manage_members_and_groups``,
``permission_settings.modify_space_details``,
``permission_settings.toggle_history``,
``permission_settings.use_at_mention_all``,
``permission_settings.manage_apps``,
``permission_settings.manage_webhooks``,
``permission_settings.reply_messages`` (Warning: mutually
exclusive with all other non-permission settings field
paths). ``permission_settings`` is not supported with
admin access.
"""

space: "Space" = proto.Field(
Expand Down
Loading
Loading