diff --git a/docs/api-ref.md b/docs/api-ref.md index 19211449f..b4aa45661 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -933,6 +933,56 @@ None.

+#### groups.add_users + +```py +groups.add_users(group_item, user_id): +``` + +Adds multiple users to the specified group. + + +REST API [Add User to Group](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#add_user_to_group) + +**Version** + +This endpoint is available with REST API version 3.21 and up. Method added in +version v0.33 + +**Parameters** + +Name | Description +:--- | :--- +`group_item` | The `group_item` specifies the group to update. +`users` | An Iterable of UserItems, or user ids. + + + + +**Returns** + +list[UserItem] + + +**Example** + +```py +# Adding a user to a group +# +# get the group item + all_groups, pagination_item = server.groups.get() + mygroup = all_groups[1] + +# Add Viewers to the group + added_users = server.groups.add_users( + mygroup, + server.users.filter(site_role=TSC.UserItem.Roles.Viewer) + ) +``` + +
+
+ #### groups.create ```py @@ -1244,6 +1294,56 @@ None. The user is removed from the group.

+#### groups.remove_users + +```py +groups.remove_users(group_item, user_id): +``` + +Removes multiple users from the specified group. + + +REST API [Remove User from Group](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#remove_user_to_group) + +**Version** + +This endpoint is available with REST API version 3.21 and up. Method added in +version v0.33 + +**Parameters** + +Name | Description +:--- | :--- +`group_item` | The `group_item` specifies the group to update. +`users` | An Iterable of UserItems, or user ids. + + + + +**Returns** + +None + + +**Example** + +```py +# Removing a user from a group +# +# get the group item + all_groups, pagination_item = server.groups.get() + mygroup = all_groups[1] + +# Remove Viewers from the group + server.groups.remove_users( + mygroup, + server.users.filter(site_role=TSC.UserItem.Roles.Viewer) + ) +``` + +
+
+ #### groups.update