class SpacesMembers extends Resource (View source)

The "members" collection of methods.

Typical usage is:

 $chatService = new Google\Service\HangoutsChat(...);
 $members = $chatService->spaces_members;

Methods

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.

delete(string $name, array $optParams = [])

Deletes a membership. For an example, see Remove a user or a Google Chat app from a space.

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.

listSpacesMembers(string $parent, array $optParams = [])

Lists memberships in a space. For an example, see List users and Google Chat apps in a space.

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)

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)

Parameters

string $parent

Required. The resource name of the space for which to create the membership. Format: spaces/{space}

Membership $postBody
array $optParams

Optional parameters.

Return Value

Membership

Exceptions

Exception

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)

Parameters

string $name

Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat 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, 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 spaces/{space}/members/app format. Format: spaces/{space}/members/{member} or spaces/{space}/members/app.

array $optParams

Optional parameters.

Return Value

Membership

Exceptions

Exception

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)

Parameters

string $name

Required. Resource name of the membership to retrieve. To get the app's own membership by using user authentication, you can optionally use spaces/{space}/members/app. Format: spaces/{space}/members/{member} or spaces/{space}/members/app When authenticated as a user, you can use the user's 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.

array $optParams

Optional parameters.

Return Value

Membership

Exceptions

Exception

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)

Parameters

string $parent

Required. The resource name of the space for which to fetch a membership list. Format: spaces/{space}

array $optParams

Optional parameters.

Return Value

ListMembershipsResponse

Exceptions

Exception

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)

Parameters

string $name

Resource name of the membership, assigned by the server. Format: spaces/{space}/members/{member}

Membership $postBody
array $optParams

Optional parameters.

Return Value

Membership

Exceptions

Exception