SpacesMembers
class SpacesMembers extends Resource (View source)
The "members" collection of methods.
Typical usage is:
$chatService = new Google\Service\HangoutsChat(...);
$members = $chatService->spaces_members;
Methods
Creates a human membership or app membership for the calling app. Creating
memberships for other apps isn't supported. For an example, see Invite or
add a user or a Google Chat app to a
space. When
creating a membership, if the specified member has their auto-accept policy
turned off, then they're invited, and must accept the space invitation before
joining. Otherwise, creating a membership adds the member directly to the
specified space. Requires user
authentication. To specify the member to add, set the
membership.member.name
for the human or app member, or set the
membership.group_member.name
for the group member. - To add the calling app
to a space or a direct message between two human users, use users/app
.
Deletes a membership. For an example, see Remove a user or a Google Chat app from a space.
Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership.
Lists memberships in a space. For an example, see List users and Google Chat apps in a space.
Updates a membership. For an example, see Update a user's membership in a space. Requires user authentication. (members.patch)
Details
Membership
create(string $parent, Membership $postBody, array $optParams = [])
Creates a human membership or app membership for the calling app. Creating
memberships for other apps isn't supported. For an example, see Invite or
add a user or a Google Chat app to a
space. When
creating a membership, if the specified member has their auto-accept policy
turned off, then they're invited, and must accept the space invitation before
joining. Otherwise, creating a membership adds the member directly to the
specified space. Requires user
authentication. To specify the member to add, set the
membership.member.name
for the human or app member, or set the
membership.group_member.name
for the group member. - To add the calling app
to a space or a direct message between two human users, use users/app
.
Unable to add other apps to the space. - To add a human user, use
users/{user}
, where {user}
can be the email address for the user. For
users in the same Workspace organization {user}
can also be the id
for
the person from the People API, or the id
for the user in the Directory
API. For example, if the People API Person profile ID for user@example.com
is 123456789
, you can add the user to the space by setting the
membership.member.name
to users/user@example.com
or users/123456789
. -
To add or invite a Google group in a named space, use groups/{group}
, where
{group}
is the id
for the group from the Cloud Identity Groups API. For
example, you can use Cloud Identity Groups lookup
API
to retrieve the ID 123456789
for group email group@example.com
, then you
can add or invite the group to a named space by setting the
membership.group_member.name
to groups/123456789
. Group email is not
supported, and Google groups can only be added as members in named spaces.
(members.create)
Membership
delete(string $name, array $optParams = [])
Deletes a membership. For an example, see Remove a user or a Google Chat app from a space.
Requires user authentication. (members.delete)
Membership
get(string $name, array $optParams = [])
Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership.
Requires authentication. Supports app authentication and user authentication. (members.get)
ListMembershipsResponse
listSpacesMembers(string $parent, array $optParams = [])
Lists memberships in a space. For an example, see List users and Google Chat apps in a space.
Listing memberships with app authentication lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with User authentication lists memberships in spaces that the authenticated user has access to. Requires authentication. Supports app authentication and user authentication. (members.listSpacesMembers)
Membership
patch(string $name, Membership $postBody, array $optParams = [])
Updates a membership. For an example, see Update a user's membership in a space. Requires user authentication. (members.patch)