diff --git a/packages/google-apps-chat/google/apps/chat/gapic_version.py b/packages/google-apps-chat/google/apps/chat/gapic_version.py index 5e9f73f4e3f5..20a9cd975b02 100644 --- a/packages/google-apps-chat/google/apps/chat/gapic_version.py +++ b/packages/google-apps-chat/google/apps/chat/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.2.7" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-chat/google/apps/chat_v1/gapic_version.py b/packages/google-apps-chat/google/apps/chat_v1/gapic_version.py index 5e9f73f4e3f5..20a9cd975b02 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/gapic_version.py +++ b/packages/google-apps-chat/google/apps/chat_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.2.7" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/async_client.py b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/async_client.py index fb41c8d43858..9b04ffaea4eb 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/async_client.py +++ b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/async_client.py @@ -363,10 +363,24 @@ async def create_message( `Send a message `__. - The ``create()`` method requires either `user - authentication `__ - or `app - authentication `__. + Supports the following types of + `authentication `__: + + - `App + authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` + + - `User + authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + Chat attributes the message sender differently depending on the type of authentication that you use in your request. @@ -546,7 +560,14 @@ async def list_messages( messages `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) .. code-block:: python @@ -691,12 +712,28 @@ async def list_memberships( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` .. code-block:: python @@ -834,12 +871,26 @@ async def get_membership( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` .. code-block:: python @@ -973,9 +1024,16 @@ async def get_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` Note: Might return a message from a blocked member or space. @@ -1104,9 +1162,17 @@ async def update_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app. @@ -1251,9 +1317,17 @@ async def delete_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app. @@ -1365,8 +1439,13 @@ async def get_attachment( API `__. For an example, see `Get metadata about a message attachment `__. + Requires `app - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.bot`` .. code-block:: python @@ -1478,7 +1557,14 @@ async def upload_attachment( attachment `__. Requires user - `authentication `__. + `authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see `File types blocked by Google @@ -1576,9 +1662,16 @@ async def list_spaces( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` To list all named spaces by Google Workspace organization, use the @@ -1681,7 +1774,13 @@ async def search_spaces( based on an administrator's search. Requires `user authentication with administrator - privileges `__. + privileges `__ + and one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + In the request, set ``use_admin_access`` to ``true``. .. code-block:: python @@ -1787,12 +1886,35 @@ async def get_space( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` with + `administrator + approval `__ - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - ``space.access_settings`` is only populated when using the + ``chat.app.spaces`` scope. + - ``space.predefind_permission_settings`` and + ``space.permission_settings`` are only populated when using + the ``chat.app.spaces`` scope, and only for spaces the app + created. .. code-block:: python @@ -1906,32 +2028,57 @@ async def create_space( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> gc_space.Space: - r"""Creates a space with no members. Can be used to create a named - space, or a group chat in ``Import mode``. For an example, see - `Create a + r"""Creates a space. Can be used to create a named space, or a group + chat in ``Import mode``. For an example, see `Create a space `__. - If you receive the error message ``ALREADY_EXISTS`` when - creating a space, try a different ``displayName``. An existing - space within the Google Workspace organization might already use - this display name. - Supports the following types of `authentication `__: - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces.create`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When authenticating as an app, the ``space.customer`` field must be set in the request. + When authenticating as an app, the Chat app is added as a member + of the space. However, unlike human authentication, the Chat app + is not added as a space manager. By default, the Chat app can be + removed from the space by all space members. To allow only space + managers to remove the app from a space, set + ``space.permission_settings.manage_apps`` to + ``managers_allowed``. + + Space membership upon creation depends on whether the space is + created in ``Import mode``: + + - **Import mode:** No members are created. + - **All other modes:** The calling user is added as a member. + This is: + + - The app itself when using app authentication. + - The human user when using user authentication. + + If you receive the error message ``ALREADY_EXISTS`` when + creating a space, try a different ``displayName``. An existing + space within the Google Workspace organization might already use + this display name. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -2107,7 +2254,12 @@ async def set_up_space( name. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` .. code-block:: python @@ -2208,15 +2360,32 @@ async def update_space( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - To update either ``space.predefined_permission_settings`` or + ``space.permission_settings``, the app must be the space + creator. + - Updating the ``space.access_settings.audience`` is not + supported for app authentication. .. code-block:: python @@ -2424,15 +2593,25 @@ async def delete_space( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.delete`` (only + in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.delete`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.delete`` .. code-block:: python @@ -2534,10 +2713,14 @@ async def complete_import_space( process `__ for the specified space and makes it visible to users. - Requires `app - authentication `__ - and domain-wide delegation. For more information, see `Authorize - Google Chat apps to import + Requires `user + authentication `__ + and domain-wide delegation with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.import`` + + For more information, see `Authorize Google Chat apps to import data `__. .. code-block:: python @@ -2639,14 +2822,21 @@ async def find_direct_message( returns the direct message space between the specified user and the authenticated user. - // Supports the following types of + Supports the following types of `authentication `__: - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` .. code-block:: python @@ -2744,24 +2934,40 @@ async def create_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to add the calling app to the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Inviting users external to the Workspace organization that + owns the space. + - Adding a Google Group to a space. + - Adding a Chat app to a space. For example usage, see: - `Invite or add a user to a space `__. - - `Invite or add a Google Group to a space `__. - - `Add the Chat app to a space `__. @@ -2825,9 +3031,7 @@ async def sample_create_membership(): - When `authenticating as an app `__, the ``chat.app.memberships`` authorization scope is - required. Authenticating as an app is available in - `Developer - Preview `__. + required. - Set ``user.type`` to ``HUMAN``, and set ``user.name`` with format ``users/{user}``, where ``{user}`` can be @@ -2943,15 +3147,25 @@ async def update_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (only in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` .. code-block:: python @@ -3089,15 +3303,36 @@ async def delete_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to remove the calling app from the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Removing a Google Group from a space. + - Removing a Chat app from a space. + + To delete memberships for space managers, the requester must be + a space manager. If you're using `app + authentication `__ + the Chat app must be the space creator. .. code-block:: python @@ -3136,12 +3371,15 @@ async def sample_delete_membership(): memberships. When deleting a human membership, requires the - ``chat.memberships`` scope and - ``spaces/{space}/members/{member}`` format. You can use - the email as an alias for ``{member}``. For example, - ``spaces/{space}/members/example@gmail.com`` where - ``example@gmail.com`` is the email of the Google Chat - user. + ``chat.memberships`` scope with `user + authentication `__ + or the ``chat.memberships.app`` scope with `app + authentication `__ + and the ``spaces/{space}/members/{member}`` format. You + can use the email as an alias for ``{member}``. For + example, ``spaces/{space}/members/example@gmail.com`` + where ``example@gmail.com`` is the email of the Google + Chat user. When deleting an app membership, requires the ``chat.memberships.app`` scope and @@ -3233,7 +3471,15 @@ async def create_reaction( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.create`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) .. code-block:: python @@ -3358,7 +3604,14 @@ async def list_reactions( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` .. code-block:: python @@ -3488,7 +3741,14 @@ async def delete_reaction( reaction `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) .. code-block:: python @@ -3599,7 +3859,11 @@ async def create_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -3711,7 +3975,12 @@ async def get_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -3839,7 +4108,12 @@ async def list_custom_emojis( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -3950,7 +4224,11 @@ async def delete_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -4063,7 +4341,12 @@ async def get_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` .. code-block:: python @@ -4199,7 +4482,11 @@ async def update_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate`` .. code-block:: python @@ -4357,7 +4644,12 @@ async def get_thread_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` .. code-block:: python @@ -4496,7 +4788,20 @@ async def get_space_event( Space object of the Space event data for this request. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To get an event, the authenticated user must be a member of the space. @@ -4626,7 +4931,20 @@ async def list_space_events( ``Membership`` resource. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To list events, the authenticated user must be a member of the space. @@ -4834,7 +5152,11 @@ async def get_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` .. code-block:: python @@ -4972,7 +5294,11 @@ async def update_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` .. code-block:: python diff --git a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/client.py b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/client.py index 7358e8249287..9e50e4f0a38e 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/client.py +++ b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/client.py @@ -954,10 +954,24 @@ def create_message( `Send a message `__. - The ``create()`` method requires either `user - authentication `__ - or `app - authentication `__. + Supports the following types of + `authentication `__: + + - `App + authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` + + - `User + authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + Chat attributes the message sender differently depending on the type of authentication that you use in your request. @@ -1134,7 +1148,14 @@ def list_messages( messages `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) .. code-block:: python @@ -1276,12 +1297,28 @@ def list_memberships( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` .. code-block:: python @@ -1416,12 +1453,26 @@ def get_membership( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` .. code-block:: python @@ -1552,9 +1603,16 @@ def get_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` Note: Might return a message from a blocked member or space. @@ -1680,9 +1738,17 @@ def update_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app. @@ -1824,9 +1890,17 @@ def delete_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app. @@ -1935,8 +2009,13 @@ def get_attachment( API `__. For an example, see `Get metadata about a message attachment `__. + Requires `app - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.bot`` .. code-block:: python @@ -2045,7 +2124,14 @@ def upload_attachment( attachment `__. Requires user - `authentication `__. + `authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see `File types blocked by Google @@ -2141,9 +2227,16 @@ def list_spaces( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` To list all named spaces by Google Workspace organization, use the @@ -2244,7 +2337,13 @@ def search_spaces( based on an administrator's search. Requires `user authentication with administrator - privileges `__. + privileges `__ + and one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + In the request, set ``use_admin_access`` to ``true``. .. code-block:: python @@ -2348,12 +2447,35 @@ def get_space( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` with + `administrator + approval `__ - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - ``space.access_settings`` is only populated when using the + ``chat.app.spaces`` scope. + - ``space.predefind_permission_settings`` and + ``space.permission_settings`` are only populated when using + the ``chat.app.spaces`` scope, and only for spaces the app + created. .. code-block:: python @@ -2464,32 +2586,57 @@ def create_space( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> gc_space.Space: - r"""Creates a space with no members. Can be used to create a named - space, or a group chat in ``Import mode``. For an example, see - `Create a + r"""Creates a space. Can be used to create a named space, or a group + chat in ``Import mode``. For an example, see `Create a space `__. - If you receive the error message ``ALREADY_EXISTS`` when - creating a space, try a different ``displayName``. An existing - space within the Google Workspace organization might already use - this display name. - Supports the following types of `authentication `__: - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces.create`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When authenticating as an app, the ``space.customer`` field must be set in the request. + When authenticating as an app, the Chat app is added as a member + of the space. However, unlike human authentication, the Chat app + is not added as a space manager. By default, the Chat app can be + removed from the space by all space members. To allow only space + managers to remove the app from a space, set + ``space.permission_settings.manage_apps`` to + ``managers_allowed``. + + Space membership upon creation depends on whether the space is + created in ``Import mode``: + + - **Import mode:** No members are created. + - **All other modes:** The calling user is added as a member. + This is: + + - The app itself when using app authentication. + - The human user when using user authentication. + + If you receive the error message ``ALREADY_EXISTS`` when + creating a space, try a different ``displayName``. An existing + space within the Google Workspace organization might already use + this display name. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -2662,7 +2809,12 @@ def set_up_space( name. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` .. code-block:: python @@ -2761,15 +2913,32 @@ def update_space( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - To update either ``space.predefined_permission_settings`` or + ``space.permission_settings``, the app must be the space + creator. + - Updating the ``space.access_settings.audience`` is not + supported for app authentication. .. code-block:: python @@ -2974,15 +3143,25 @@ def delete_space( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.delete`` (only + in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.delete`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.delete`` .. code-block:: python @@ -3081,10 +3260,14 @@ def complete_import_space( process `__ for the specified space and makes it visible to users. - Requires `app - authentication `__ - and domain-wide delegation. For more information, see `Authorize - Google Chat apps to import + Requires `user + authentication `__ + and domain-wide delegation with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.import`` + + For more information, see `Authorize Google Chat apps to import data `__. .. code-block:: python @@ -3184,14 +3367,21 @@ def find_direct_message( returns the direct message space between the specified user and the authenticated user. - // Supports the following types of + Supports the following types of `authentication `__: - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` .. code-block:: python @@ -3287,24 +3477,40 @@ def create_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to add the calling app to the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Inviting users external to the Workspace organization that + owns the space. + - Adding a Google Group to a space. + - Adding a Chat app to a space. For example usage, see: - `Invite or add a user to a space `__. - - `Invite or add a Google Group to a space `__. - - `Add the Chat app to a space `__. @@ -3368,9 +3574,7 @@ def sample_create_membership(): - When `authenticating as an app `__, the ``chat.app.memberships`` authorization scope is - required. Authenticating as an app is available in - `Developer - Preview `__. + required. - Set ``user.type`` to ``HUMAN``, and set ``user.name`` with format ``users/{user}``, where ``{user}`` can be @@ -3483,15 +3687,25 @@ def update_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (only in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` .. code-block:: python @@ -3626,15 +3840,36 @@ def delete_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to remove the calling app from the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Removing a Google Group from a space. + - Removing a Chat app from a space. + + To delete memberships for space managers, the requester must be + a space manager. If you're using `app + authentication `__ + the Chat app must be the space creator. .. code-block:: python @@ -3673,12 +3908,15 @@ def sample_delete_membership(): memberships. When deleting a human membership, requires the - ``chat.memberships`` scope and - ``spaces/{space}/members/{member}`` format. You can use - the email as an alias for ``{member}``. For example, - ``spaces/{space}/members/example@gmail.com`` where - ``example@gmail.com`` is the email of the Google Chat - user. + ``chat.memberships`` scope with `user + authentication `__ + or the ``chat.memberships.app`` scope with `app + authentication `__ + and the ``spaces/{space}/members/{member}`` format. You + can use the email as an alias for ``{member}``. For + example, ``spaces/{space}/members/example@gmail.com`` + where ``example@gmail.com`` is the email of the Google + Chat user. When deleting an app membership, requires the ``chat.memberships.app`` scope and @@ -3767,7 +4005,15 @@ def create_reaction( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.create`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) .. code-block:: python @@ -3889,7 +4135,14 @@ def list_reactions( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` .. code-block:: python @@ -4016,7 +4269,14 @@ def delete_reaction( reaction `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) .. code-block:: python @@ -4124,7 +4384,11 @@ def create_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -4233,7 +4497,12 @@ def get_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -4358,7 +4627,12 @@ def list_custom_emojis( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -4467,7 +4741,11 @@ def delete_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` .. code-block:: python @@ -4577,7 +4855,12 @@ def get_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` .. code-block:: python @@ -4710,7 +4993,11 @@ def update_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate`` .. code-block:: python @@ -4865,7 +5152,12 @@ def get_thread_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` .. code-block:: python @@ -5001,7 +5293,20 @@ def get_space_event( Space object of the Space event data for this request. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To get an event, the authenticated user must be a member of the space. @@ -5128,7 +5433,20 @@ def list_space_events( ``Membership`` resource. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To list events, the authenticated user must be a member of the space. @@ -5333,7 +5651,11 @@ def get_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` .. code-block:: python @@ -5470,7 +5792,11 @@ def update_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` .. code-block:: python diff --git a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/base.py b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/base.py index e6f3a0879a4c..d0925c14c172 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/base.py +++ b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/base.py @@ -62,6 +62,10 @@ class ChatServiceTransport(abc.ABC): "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.app.delete", + "https://www.googleapis.com/auth/chat.app.memberships", + "https://www.googleapis.com/auth/chat.app.spaces", + "https://www.googleapis.com/auth/chat.app.spaces.create", "https://www.googleapis.com/auth/chat.bot", "https://www.googleapis.com/auth/chat.customemojis", "https://www.googleapis.com/auth/chat.customemojis.readonly", diff --git a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc.py b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc.py index 42a26978e86c..da46d8cac3cc 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc.py +++ b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc.py @@ -347,10 +347,24 @@ def create_message( `Send a message `__. - The ``create()`` method requires either `user - authentication `__ - or `app - authentication `__. + Supports the following types of + `authentication `__: + + - `App + authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` + + - `User + authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + Chat attributes the message sender differently depending on the type of authentication that you use in your request. @@ -414,7 +428,14 @@ def list_messages( messages `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) Returns: Callable[[~.ListMessagesRequest], @@ -459,12 +480,28 @@ def list_memberships( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` Returns: Callable[[~.ListMembershipsRequest], @@ -499,12 +536,26 @@ def get_membership( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` Returns: Callable[[~.GetMembershipRequest], @@ -537,9 +588,16 @@ def get_message(self) -> Callable[[message.GetMessageRequest], message.Message]: - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` Note: Might return a message from a blocked member or space. @@ -579,9 +637,17 @@ def update_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app. @@ -618,9 +684,17 @@ def delete_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app. @@ -654,8 +728,13 @@ def get_attachment( API `__. For an example, see `Get metadata about a message attachment `__. + Requires `app - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.bot`` Returns: Callable[[~.GetAttachmentRequest], @@ -688,7 +767,14 @@ def upload_attachment( attachment `__. Requires user - `authentication `__. + `authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see `File types blocked by Google @@ -728,9 +814,16 @@ def list_spaces( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` To list all named spaces by Google Workspace organization, use the @@ -765,7 +858,13 @@ def search_spaces( based on an administrator's search. Requires `user authentication with administrator - privileges `__. + privileges `__ + and one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + In the request, set ``use_admin_access`` to ``true``. Returns: @@ -799,12 +898,35 @@ def get_space(self) -> Callable[[space.GetSpaceRequest], space.Space]: - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` with + `administrator + approval `__ - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - ``space.access_settings`` is only populated when using the + ``chat.app.spaces`` scope. + - ``space.predefind_permission_settings`` and + ``space.permission_settings`` are only populated when using + the ``chat.app.spaces`` scope, and only for spaces the app + created. Returns: Callable[[~.GetSpaceRequest], @@ -828,32 +950,57 @@ def get_space(self) -> Callable[[space.GetSpaceRequest], space.Space]: def create_space(self) -> Callable[[gc_space.CreateSpaceRequest], gc_space.Space]: r"""Return a callable for the create space method over gRPC. - Creates a space with no members. Can be used to create a named - space, or a group chat in ``Import mode``. For an example, see - `Create a + Creates a space. Can be used to create a named space, or a group + chat in ``Import mode``. For an example, see `Create a space `__. - If you receive the error message ``ALREADY_EXISTS`` when - creating a space, try a different ``displayName``. An existing - space within the Google Workspace organization might already use - this display name. - Supports the following types of `authentication `__: - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces.create`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When authenticating as an app, the ``space.customer`` field must be set in the request. + When authenticating as an app, the Chat app is added as a member + of the space. However, unlike human authentication, the Chat app + is not added as a space manager. By default, the Chat app can be + removed from the space by all space members. To allow only space + managers to remove the app from a space, set + ``space.permission_settings.manage_apps`` to + ``managers_allowed``. + + Space membership upon creation depends on whether the space is + created in ``Import mode``: + + - **Import mode:** No members are created. + - **All other modes:** The calling user is added as a member. + This is: + + - The app itself when using app authentication. + - The human user when using user authentication. + + If you receive the error message ``ALREADY_EXISTS`` when + creating a space, try a different ``displayName``. An existing + space within the Google Workspace organization might already use + this display name. + Returns: Callable[[~.CreateSpaceRequest], ~.Space]: @@ -933,7 +1080,12 @@ def set_up_space(self) -> Callable[[space_setup.SetUpSpaceRequest], space.Space] name. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` Returns: Callable[[~.SetUpSpaceRequest], @@ -971,15 +1123,32 @@ def update_space(self) -> Callable[[gc_space.UpdateSpaceRequest], gc_space.Space - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - To update either ``space.predefined_permission_settings`` or + ``space.permission_settings``, the app must be the space + creator. + - Updating the ``space.access_settings.audience`` is not + supported for app authentication. Returns: Callable[[~.UpdateSpaceRequest], @@ -1015,15 +1184,25 @@ def delete_space(self) -> Callable[[space.DeleteSpaceRequest], empty_pb2.Empty]: - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.delete`` (only + in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.delete`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.delete`` Returns: Callable[[~.DeleteSpaceRequest], @@ -1055,10 +1234,14 @@ def complete_import_space( process `__ for the specified space and makes it visible to users. - Requires `app - authentication `__ - and domain-wide delegation. For more information, see `Authorize - Google Chat apps to import + Requires `user + authentication `__ + and domain-wide delegation with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.import`` + + For more information, see `Authorize Google Chat apps to import data `__. Returns: @@ -1100,14 +1283,21 @@ def find_direct_message( returns the direct message space between the specified user and the authenticated user. - // Supports the following types of + Supports the following types of `authentication `__: - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` Returns: Callable[[~.FindDirectMessageRequest], @@ -1147,24 +1337,40 @@ def create_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to add the calling app to the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Inviting users external to the Workspace organization that + owns the space. + - Adding a Google Group to a space. + - Adding a Chat app to a space. For example usage, see: - `Invite or add a user to a space `__. - - `Invite or add a Google Group to a space `__. - - `Add the Chat app to a space `__. @@ -1202,15 +1408,25 @@ def update_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (only in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` Returns: Callable[[~.UpdateMembershipRequest], @@ -1246,15 +1462,36 @@ def delete_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to remove the calling app from the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Removing a Google Group from a space. + - Removing a Chat app from a space. + + To delete memberships for space managers, the requester must be + a space manager. If you're using `app + authentication `__ + the Chat app must be the space creator. Returns: Callable[[~.DeleteMembershipRequest], @@ -1285,7 +1522,15 @@ def create_reaction( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.create`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) Returns: Callable[[~.CreateReactionRequest], @@ -1316,7 +1561,14 @@ def list_reactions( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` Returns: Callable[[~.ListReactionsRequest], @@ -1346,7 +1598,14 @@ def delete_reaction( reaction `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) Returns: Callable[[~.DeleteReactionRequest], @@ -1383,7 +1642,11 @@ def create_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.CreateCustomEmojiRequest], @@ -1420,7 +1683,12 @@ def get_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.GetCustomEmojiRequest], @@ -1459,7 +1727,12 @@ def list_custom_emojis( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.ListCustomEmojisRequest], @@ -1501,7 +1774,11 @@ def delete_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.DeleteCustomEmojiRequest], @@ -1535,7 +1812,12 @@ def get_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` Returns: Callable[[~.GetSpaceReadStateRequest], @@ -1570,7 +1852,11 @@ def update_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate`` Returns: Callable[[~.UpdateSpaceReadStateRequest], @@ -1604,7 +1890,12 @@ def get_thread_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` Returns: Callable[[~.GetThreadReadStateRequest], @@ -1641,7 +1932,20 @@ def get_space_event( Space object of the Space event data for this request. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To get an event, the authenticated user must be a member of the space. @@ -1685,7 +1989,20 @@ def list_space_events( ``Membership`` resource. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To list events, the authenticated user must be a member of the space. @@ -1724,7 +2041,11 @@ def get_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` Returns: Callable[[~.GetSpaceNotificationSettingRequest], @@ -1761,7 +2082,11 @@ def update_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` Returns: Callable[[~.UpdateSpaceNotificationSettingRequest], diff --git a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc_asyncio.py b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc_asyncio.py index 09fc3ed303ae..459c4f55205b 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc_asyncio.py +++ b/packages/google-apps-chat/google/apps/chat_v1/services/chat_service/transports/grpc_asyncio.py @@ -355,10 +355,24 @@ def create_message( `Send a message `__. - The ``create()`` method requires either `user - authentication `__ - or `app - authentication `__. + Supports the following types of + `authentication `__: + + - `App + authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` + + - `User + authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + Chat attributes the message sender differently depending on the type of authentication that you use in your request. @@ -424,7 +438,14 @@ def list_messages( messages `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) Returns: Callable[[~.ListMessagesRequest], @@ -470,12 +491,28 @@ def list_memberships( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` Returns: Callable[[~.ListMembershipsRequest], @@ -510,12 +547,26 @@ def get_membership( - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (requires `administrator + approval `__) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.memberships`` Returns: Callable[[~.GetMembershipRequest], @@ -550,9 +601,16 @@ def get_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` Note: Might return a message from a blocked member or space. @@ -592,9 +650,17 @@ def update_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app. @@ -631,9 +697,17 @@ def delete_message( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app. @@ -667,8 +741,13 @@ def get_attachment( API `__. For an example, see `Get metadata about a message attachment `__. + Requires `app - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.bot`` Returns: Callable[[~.GetAttachmentRequest], @@ -702,7 +781,14 @@ def upload_attachment( attachment `__. Requires user - `authentication `__. + `authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.create`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see `File types blocked by Google @@ -742,9 +828,16 @@ def list_spaces( - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` To list all named spaces by Google Workspace organization, use the @@ -779,7 +872,13 @@ def search_spaces( based on an administrator's search. Requires `user authentication with administrator - privileges `__. + privileges `__ + and one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + In the request, set ``use_admin_access`` to ``true``. Returns: @@ -813,12 +912,35 @@ def get_space(self) -> Callable[[space.GetSpaceRequest], Awaitable[space.Space]] - `App authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.bot`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` with + `administrator + approval `__ - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and one of the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - ``space.access_settings`` is only populated when using the + ``chat.app.spaces`` scope. + - ``space.predefind_permission_settings`` and + ``space.permission_settings`` are only populated when using + the ``chat.app.spaces`` scope, and only for spaces the app + created. Returns: Callable[[~.GetSpaceRequest], @@ -844,32 +966,57 @@ def create_space( ) -> Callable[[gc_space.CreateSpaceRequest], Awaitable[gc_space.Space]]: r"""Return a callable for the create space method over gRPC. - Creates a space with no members. Can be used to create a named - space, or a group chat in ``Import mode``. For an example, see - `Create a + Creates a space. Can be used to create a named space, or a group + chat in ``Import mode``. For an example, see `Create a space `__. - If you receive the error message ``ALREADY_EXISTS`` when - creating a space, try a different ``displayName``. An existing - space within the Google Workspace organization might already use - this display name. - Supports the following types of `authentication `__: - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces.create`` + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) When authenticating as an app, the ``space.customer`` field must be set in the request. + When authenticating as an app, the Chat app is added as a member + of the space. However, unlike human authentication, the Chat app + is not added as a space manager. By default, the Chat app can be + removed from the space by all space members. To allow only space + managers to remove the app from a space, set + ``space.permission_settings.manage_apps`` to + ``managers_allowed``. + + Space membership upon creation depends on whether the space is + created in ``Import mode``: + + - **Import mode:** No members are created. + - **All other modes:** The calling user is added as a member. + This is: + + - The app itself when using app authentication. + - The human user when using user authentication. + + If you receive the error message ``ALREADY_EXISTS`` when + creating a space, try a different ``displayName``. An existing + space within the Google Workspace organization might already use + this display name. + Returns: Callable[[~.CreateSpaceRequest], Awaitable[~.Space]]: @@ -951,7 +1098,12 @@ def set_up_space( name. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.spaces.create`` + - ``https://www.googleapis.com/auth/chat.spaces`` Returns: Callable[[~.SetUpSpaceRequest], @@ -991,15 +1143,32 @@ def update_space( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.app.spaces`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scopes is used: + + - ``https://www.googleapis.com/auth/chat.admin.spaces`` + + App authentication has the following limitations: + + - To update either ``space.predefined_permission_settings`` or + ``space.permission_settings``, the app must be the space + creator. + - Updating the ``space.access_settings.audience`` is not + supported for app authentication. Returns: Callable[[~.UpdateSpaceRequest], @@ -1037,15 +1206,25 @@ def delete_space( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.delete`` (only + in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.delete`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.delete`` Returns: Callable[[~.DeleteSpaceRequest], @@ -1077,10 +1256,14 @@ def complete_import_space( process `__ for the specified space and makes it visible to users. - Requires `app - authentication `__ - and domain-wide delegation. For more information, see `Authorize - Google Chat apps to import + Requires `user + authentication `__ + and domain-wide delegation with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.import`` + + For more information, see `Authorize Google Chat apps to import data `__. Returns: @@ -1122,14 +1305,21 @@ def find_direct_message( returns the direct message space between the specified user and the authenticated user. - // Supports the following types of + Supports the following types of `authentication `__: - `App authentication `__ + with the authorization scope: + + - ``https://www.googleapis.com/auth/chat.bot`` - `User authentication `__ + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` Returns: Callable[[~.FindDirectMessageRequest], @@ -1171,24 +1361,40 @@ def create_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to add the calling app to the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Inviting users external to the Workspace organization that + owns the space. + - Adding a Google Group to a space. + - Adding a Chat app to a space. For example usage, see: - `Invite or add a user to a space `__. - - `Invite or add a Google Group to a space `__. - - `Add the Chat app to a space `__. @@ -1228,15 +1434,25 @@ def update_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` + (only in spaces the app created) - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` Returns: Callable[[~.UpdateMembershipRequest], @@ -1274,15 +1490,36 @@ def delete_membership( - `App authentication `__ with `administrator - approval `__ in - `Developer - Preview `__ + approval `__ + and the authorization scope: + + - ``https://www.googleapis.com/auth/chat.app.memberships`` - `User authentication `__ - You can authenticate and authorize this method with - administrator privileges by setting the ``use_admin_access`` - field in the request. + with one of the following authorization scopes: + + - ``https://www.googleapis.com/auth/chat.memberships`` + - ``https://www.googleapis.com/auth/chat.memberships.app`` + (to remove the calling app from the space) + - ``https://www.googleapis.com/auth/chat.import`` (import + mode spaces only) + - User authentication grants administrator privileges when + an administrator account authenticates, + ``use_admin_access`` is ``true``, and the following + authorization scope is used: + + - ``https://www.googleapis.com/auth/chat.admin.memberships`` + + App authentication is not supported for the following use cases: + + - Removing a Google Group from a space. + - Removing a Chat app from a space. + + To delete memberships for space managers, the requester must be + a space manager. If you're using `app + authentication `__ + the Chat app must be the space creator. Returns: Callable[[~.DeleteMembershipRequest], @@ -1313,7 +1550,15 @@ def create_reaction( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.create`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) Returns: Callable[[~.CreateReactionRequest], @@ -1346,7 +1591,14 @@ def list_reactions( message `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` Returns: Callable[[~.ListReactionsRequest], @@ -1376,7 +1628,14 @@ def delete_reaction( reaction `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.import`` (import mode + spaces only) Returns: Callable[[~.DeleteReactionRequest], @@ -1413,7 +1672,11 @@ def create_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.CreateCustomEmojiRequest], @@ -1450,7 +1713,12 @@ def get_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.GetCustomEmojiRequest], @@ -1489,7 +1757,12 @@ def list_custom_emojis( permissions `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.customemojis.readonly`` + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.ListCustomEmojisRequest], @@ -1531,7 +1804,11 @@ def delete_custom_emoji( permissions `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.customemojis`` Returns: Callable[[~.DeleteCustomEmojiRequest], @@ -1566,7 +1843,12 @@ def get_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` Returns: Callable[[~.GetSpaceReadStateRequest], @@ -1601,7 +1883,11 @@ def update_space_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate`` Returns: Callable[[~.UpdateSpaceReadStateRequest], @@ -1636,7 +1922,12 @@ def get_thread_read_state( state `__. Requires `user - authentication `__. + authentication `__ + with one of the following `authorization + scopes `__: + + - ``https://www.googleapis.com/auth/chat.users.readstate.readonly`` + - ``https://www.googleapis.com/auth/chat.users.readstate`` Returns: Callable[[~.GetThreadReadStateRequest], @@ -1675,7 +1966,20 @@ def get_space_event( Space object of the Space event data for this request. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To get an event, the authenticated user must be a member of the space. @@ -1720,7 +2024,20 @@ def list_space_events( ``Membership`` resource. Requires `user - authentication `__. + authentication `__ + with an `authorization + scope `__ + appropriate for reading the requested data: + + - ``https://www.googleapis.com/auth/chat.spaces.readonly`` + - ``https://www.googleapis.com/auth/chat.spaces`` + - ``https://www.googleapis.com/auth/chat.messages.readonly`` + - ``https://www.googleapis.com/auth/chat.messages`` + - ``https://www.googleapis.com/auth/chat.messages.reactions.readonly`` + - ``https://www.googleapis.com/auth/chat.messages.reactions`` + - ``https://www.googleapis.com/auth/chat.memberships.readonly`` + - ``https://www.googleapis.com/auth/chat.memberships`` + To list events, the authenticated user must be a member of the space. @@ -1759,7 +2076,11 @@ def get_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` Returns: Callable[[~.GetSpaceNotificationSettingRequest], @@ -1796,7 +2117,11 @@ def update_space_notification_setting( setting `__. Requires `user - authentication `__. + authentication `__ + with the `authorization + scope `__: + + - ``https://www.googleapis.com/auth/chat.users.spacesettings`` Returns: Callable[[~.UpdateSpaceNotificationSettingRequest], diff --git a/packages/google-apps-chat/google/apps/chat_v1/types/deletion_metadata.py b/packages/google-apps-chat/google/apps/chat_v1/types/deletion_metadata.py index 4205bc414bec..eb92ab43eb18 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/types/deletion_metadata.py +++ b/packages/google-apps-chat/google/apps/chat_v1/types/deletion_metadata.py @@ -37,8 +37,10 @@ class DeletionMetadata(proto.Message): """ class DeletionType(proto.Enum): - r"""Who deleted the message and how it was deleted. More values - may be added in the future. + r"""Who deleted the message and how it was deleted. More values may be + added in the future. See `Edit or delete a message in Google + Chat `__ for details + on when messages can be deleted. Values: DELETION_TYPE_UNSPECIFIED (0): @@ -46,21 +48,24 @@ class DeletionType(proto.Enum): CREATOR (1): User deleted their own message. SPACE_OWNER (2): - The space owner deleted the message. + A space manager deleted the message. ADMIN (3): - A Google Workspace admin deleted the message. + A Google Workspace administrator deleted the + message. Administrators can delete any message + in the space, including messages sent by any + space member or Chat app. APP_MESSAGE_EXPIRY (4): A Chat app deleted its own message when it expired. CREATOR_VIA_APP (5): A Chat app deleted the message on behalf of - the user. + the creator (using user authentication). SPACE_OWNER_VIA_APP (6): - A Chat app deleted the message on behalf of - the space owner. + A Chat app deleted the message on behalf of a + space manager (using user authentication). SPACE_MEMBER (7): A member of the space deleted the message. - Human users can delete messages sent by apps. + Users can delete messages sent by apps. """ DELETION_TYPE_UNSPECIFIED = 0 CREATOR = 1 diff --git a/packages/google-apps-chat/google/apps/chat_v1/types/membership.py b/packages/google-apps-chat/google/apps/chat_v1/types/membership.py index e3ecdb5dacdb..0a6709ac2783 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/types/membership.py +++ b/packages/google-apps-chat/google/apps/chat_v1/types/membership.py @@ -210,9 +210,7 @@ class CreateMembershipRequest(proto.Message): - When `authenticating as an app `__, the ``chat.app.memberships`` authorization scope is - required. Authenticating as an app is available in - `Developer - Preview `__. + required. - Set ``user.type`` to ``HUMAN``, and set ``user.name`` with format ``users/{user}``, where ``{user}`` can be the @@ -527,9 +525,12 @@ class DeleteMembershipRequest(proto.Message): apps can't delete other apps' memberships. When deleting a human membership, requires the - ``chat.memberships`` scope and - ``spaces/{space}/members/{member}`` format. You can use the - email as an alias for ``{member}``. For example, + ``chat.memberships`` scope with `user + authentication `__ + or the ``chat.memberships.app`` scope with `app + authentication `__ + and the ``spaces/{space}/members/{member}`` format. You can + use the email as an alias for ``{member}``. For example, ``spaces/{space}/members/example@gmail.com`` where ``example@gmail.com`` is the email of the Google Chat user. diff --git a/packages/google-apps-chat/google/apps/chat_v1/types/slash_command.py b/packages/google-apps-chat/google/apps/chat_v1/types/slash_command.py index 56fe7c01a217..85de3c13c5e0 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/types/slash_command.py +++ b/packages/google-apps-chat/google/apps/chat_v1/types/slash_command.py @@ -28,13 +28,13 @@ class SlashCommand(proto.Message): - r"""A `slash + r"""Metadata about a `slash command `__ in Google Chat. Attributes: command_id (int): - The ID of the slash command invoked. + The ID of the slash command. """ command_id: int = proto.Field( diff --git a/packages/google-apps-chat/google/apps/chat_v1/types/space.py b/packages/google-apps-chat/google/apps/chat_v1/types/space.py index 07ec5b907cd0..4adb8bd748d8 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/types/space.py +++ b/packages/google-apps-chat/google/apps/chat_v1/types/space.py @@ -153,6 +153,22 @@ class Space(proto.Message): setting `__ of the space. Only populated when the ``space_type`` is ``SPACE``. + customer (str): + Optional. Immutable. The customer id of the domain of the + space. Required only when creating a space with `app + authentication `__ + and ``SpaceType`` is ``SPACE``, otherwise should not be set. + + In the format ``customers/{customer}``, where ``customer`` + is the ``id`` from the `Admin SDK customer + resource `__. + Private apps can also use the ``customers/my_customer`` + alias to create the space in the same Google Workspace + organization as the app. + + For DMs, this field isn't populated. + + This field is a member of `oneof`_ ``_customer``. space_uri (str): Output only. The URI for a user to access the space. @@ -162,13 +178,36 @@ class Space(proto.Message): collaboration space is created. After you create the space, settings are populated in the ``PermissionSettings`` field. + Setting predefined permission settings supports: + + - `App + authentication `__ + with `administrator + approval `__ + with the ``chat.app.spaces`` or + ``chat.app.spaces.create`` scopes. + + - `User + authentication `__ + This field is a member of `oneof`_ ``space_permission_settings``. permission_settings (google.apps.chat_v1.types.Space.PermissionSettings): - Optional. Space permission settings for - existing spaces. Input for updating exact space - permission settings, where existing permission - settings are replaced. Output lists current - permission settings. + Optional. Space permission settings for existing spaces. + Input for updating exact space permission settings, where + existing permission settings are replaced. Output lists + current permission settings. + + Reading and updating permission settings supports: + + - `App + authentication `__ + with `administrator + approval `__ + with the ``chat.app.spaces`` scope. Only populated and + settable when the Chat app created the space. + + - `User + authentication `__ This field is a member of `oneof`_ ``space_permission_settings``. import_mode_expire_time (google.protobuf.timestamp_pb2.Timestamp): @@ -348,8 +387,7 @@ class AccessSettings(proto.Message): authentication `__ with `administrator approval `__ - with the ``chat.app.spaces`` scope in `Developer - Preview `__. + with the ``chat.app.spaces`` scope. This field is not populated when using the ``chat.bot`` scope with `app @@ -592,6 +630,11 @@ class PermissionSetting(proto.Message): number=23, message=AccessSettings, ) + customer: str = proto.Field( + proto.STRING, + number=24, + optional=True, + ) space_uri: str = proto.Field( proto.STRING, number=25, diff --git a/packages/google-apps-chat/google/apps/chat_v1/types/space_setup.py b/packages/google-apps-chat/google/apps/chat_v1/types/space_setup.py index 8d037ae1ad19..27bdd4939c6e 100644 --- a/packages/google-apps-chat/google/apps/chat_v1/types/space_setup.py +++ b/packages/google-apps-chat/google/apps/chat_v1/types/space_setup.py @@ -73,7 +73,7 @@ class SetUpSpaceRequest(proto.Message): the space. Omit the calling user, as they are added automatically. - The set currently allows up to 20 memberships (in addition + The set currently allows up to 49 memberships (in addition to the caller). For human membership, the ``Membership.member`` field must diff --git a/packages/google-apps-chat/samples/generated_samples/snippet_metadata_google.chat.v1.json b/packages/google-apps-chat/samples/generated_samples/snippet_metadata_google.chat.v1.json index 1564980030d7..1f7b60d64e72 100644 --- a/packages/google-apps-chat/samples/generated_samples/snippet_metadata_google.chat.v1.json +++ b/packages/google-apps-chat/samples/generated_samples/snippet_metadata_google.chat.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-apps-chat", - "version": "0.2.7" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-apps-chat/tests/unit/gapic/chat_v1/test_chat_service.py b/packages/google-apps-chat/tests/unit/gapic/chat_v1/test_chat_service.py index 8f73e5136661..e7b6df6f7822 100644 --- a/packages/google-apps-chat/tests/unit/gapic/chat_v1/test_chat_service.py +++ b/packages/google-apps-chat/tests/unit/gapic/chat_v1/test_chat_service.py @@ -1101,6 +1101,10 @@ def test_chat_service_client_create_channel_credentials_file( "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.app.delete", + "https://www.googleapis.com/auth/chat.app.memberships", + "https://www.googleapis.com/auth/chat.app.spaces", + "https://www.googleapis.com/auth/chat.app.spaces.create", "https://www.googleapis.com/auth/chat.bot", "https://www.googleapis.com/auth/chat.customemojis", "https://www.googleapis.com/auth/chat.customemojis.readonly", @@ -5257,6 +5261,7 @@ def test_get_space(request_type, transport: str = "grpc"): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -5284,6 +5289,7 @@ def test_get_space(request_type, transport: str = "grpc"): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -5419,6 +5425,7 @@ async def test_get_space_async( space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -5446,6 +5453,7 @@ async def test_get_space_async( assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -5625,6 +5633,7 @@ def test_create_space(request_type, transport: str = "grpc"): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=gc_space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -5652,6 +5661,7 @@ def test_create_space(request_type, transport: str = "grpc"): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -5789,6 +5799,7 @@ async def test_create_space_async( space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -5816,6 +5827,7 @@ async def test_create_space_async( assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -5936,6 +5948,7 @@ def test_set_up_space(request_type, transport: str = "grpc"): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -5963,6 +5976,7 @@ def test_set_up_space(request_type, transport: str = "grpc"): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -6100,6 +6114,7 @@ async def test_set_up_space_async( space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -6127,6 +6142,7 @@ async def test_set_up_space_async( assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -6167,6 +6183,7 @@ def test_update_space(request_type, transport: str = "grpc"): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=gc_space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -6194,6 +6211,7 @@ def test_update_space(request_type, transport: str = "grpc"): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -6327,6 +6345,7 @@ async def test_update_space_async( space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -6354,6 +6373,7 @@ async def test_update_space_async( assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -7106,6 +7126,7 @@ def test_find_direct_message(request_type, transport: str = "grpc"): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -7133,6 +7154,7 @@ def test_find_direct_message(request_type, transport: str = "grpc"): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -7278,6 +7300,7 @@ async def test_find_direct_message_async( space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -7305,6 +7328,7 @@ async def test_find_direct_message_async( assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -21138,6 +21162,7 @@ async def test_get_space_empty_call_grpc_asyncio(): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -21176,6 +21201,7 @@ async def test_create_space_empty_call_grpc_asyncio(): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -21214,6 +21240,7 @@ async def test_set_up_space_empty_call_grpc_asyncio(): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -21252,6 +21279,7 @@ async def test_update_space_empty_call_grpc_asyncio(): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -21342,6 +21370,7 @@ async def test_find_direct_message_empty_call_grpc_asyncio(): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", ) ) @@ -22234,6 +22263,7 @@ def test_create_message_rest_call_success(request_type): "joined_group_count": 1933, }, "access_settings": {"access_state": 1, "audience": "audience_value"}, + "customer": "customer_value", "space_uri": "space_uri_value", "predefined_permission_settings": 1, "permission_settings": { @@ -23359,6 +23389,7 @@ def test_update_message_rest_call_success(request_type): "joined_group_count": 1933, }, "access_settings": {"access_state": 1, "audience": "audience_value"}, + "customer": "customer_value", "space_uri": "space_uri_value", "predefined_permission_settings": 1, "permission_settings": { @@ -24259,6 +24290,7 @@ def test_get_space_rest_call_success(request_type): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -24291,6 +24323,7 @@ def test_get_space_rest_call_success(request_type): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -24414,6 +24447,7 @@ def test_create_space_rest_call_success(request_type): "joined_group_count": 1933, }, "access_settings": {"access_state": 1, "audience": "audience_value"}, + "customer": "customer_value", "space_uri": "space_uri_value", "predefined_permission_settings": 1, "permission_settings": { @@ -24515,6 +24549,7 @@ def get_message_fields(field): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=gc_space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -24547,6 +24582,7 @@ def get_message_fields(field): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -24664,6 +24700,7 @@ def test_set_up_space_rest_call_success(request_type): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -24696,6 +24733,7 @@ def test_set_up_space_rest_call_success(request_type): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -24819,6 +24857,7 @@ def test_update_space_rest_call_success(request_type): "joined_group_count": 1933, }, "access_settings": {"access_state": 1, "audience": "audience_value"}, + "customer": "customer_value", "space_uri": "space_uri_value", "predefined_permission_settings": 1, "permission_settings": { @@ -24920,6 +24959,7 @@ def get_message_fields(field): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=gc_space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -24952,6 +24992,7 @@ def get_message_fields(field): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -25303,6 +25344,7 @@ def test_find_direct_message_rest_call_success(request_type): space_history_state=history_state.HistoryState.HISTORY_OFF, import_mode=True, admin_installed=True, + customer="customer_value", space_uri="space_uri_value", predefined_permission_settings=space.Space.PredefinedPermissionSettings.COLLABORATION_SPACE, ) @@ -25335,6 +25377,7 @@ def test_find_direct_message_rest_call_success(request_type): assert response.space_history_state == history_state.HistoryState.HISTORY_OFF assert response.import_mode is True assert response.admin_installed is True + assert response.customer == "customer_value" assert response.space_uri == "space_uri_value" @@ -28933,6 +28976,10 @@ def test_chat_service_base_transport_with_credentials_file(): "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.app.delete", + "https://www.googleapis.com/auth/chat.app.memberships", + "https://www.googleapis.com/auth/chat.app.spaces", + "https://www.googleapis.com/auth/chat.app.spaces.create", "https://www.googleapis.com/auth/chat.bot", "https://www.googleapis.com/auth/chat.customemojis", "https://www.googleapis.com/auth/chat.customemojis.readonly", @@ -28982,6 +29029,10 @@ def test_chat_service_auth_adc(): "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.app.delete", + "https://www.googleapis.com/auth/chat.app.memberships", + "https://www.googleapis.com/auth/chat.app.spaces", + "https://www.googleapis.com/auth/chat.app.spaces.create", "https://www.googleapis.com/auth/chat.bot", "https://www.googleapis.com/auth/chat.customemojis", "https://www.googleapis.com/auth/chat.customemojis.readonly", @@ -29028,6 +29079,10 @@ def test_chat_service_transport_auth_adc(transport_class): "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.app.delete", + "https://www.googleapis.com/auth/chat.app.memberships", + "https://www.googleapis.com/auth/chat.app.spaces", + "https://www.googleapis.com/auth/chat.app.spaces.create", "https://www.googleapis.com/auth/chat.bot", "https://www.googleapis.com/auth/chat.customemojis", "https://www.googleapis.com/auth/chat.customemojis.readonly", @@ -29106,6 +29161,10 @@ def test_chat_service_transport_create_channel(transport_class, grpc_helpers): "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.app.delete", + "https://www.googleapis.com/auth/chat.app.memberships", + "https://www.googleapis.com/auth/chat.app.spaces", + "https://www.googleapis.com/auth/chat.app.spaces.create", "https://www.googleapis.com/auth/chat.bot", "https://www.googleapis.com/auth/chat.customemojis", "https://www.googleapis.com/auth/chat.customemojis.readonly",