class Users extends Resource (View source)

The "users" collection of methods.

Typical usage is:

 $adminService = new Google\Service\Directory(...);
 $users = $adminService->users;

Methods

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

Deletes a user. (users.delete)

get(string $userKey, array $optParams = [])

Retrieves a user. (users.get)

insert(User $postBody, array $optParams = [])

Creates a user. Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case. If resolveConflictAccount is set to true, a 202 response code means that a conflicting unmanaged account exists and was invited to join the organization. A 409 response code means that a conflicting account exists so the user wasn't created based on the handling unmanaged user accounts option selected. (users.insert)

listUsers(array $optParams = [])

Retrieves a paginated list of either deleted users or all users in a domain.

makeAdmin(string $userKey, UserMakeAdmin $postBody, array $optParams = [])

Makes a user a super administrator. (users.makeAdmin)

patch(string $userKey, User $postBody, array $optParams = [])

Updates a user using patch semantics. The update method should be used instead, because it also supports patch semantics and has better performance.

signOut(string $userKey, array $optParams = [])

Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again. (users.signOut)

undelete(string $userKey, UserUndelete $postBody, array $optParams = [])

Undeletes a deleted user. (users.undelete)

update(string $userKey, User $postBody, array $optParams = [])

Updates a user. This method supports patch semantics, meaning that you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to null will be cleared. For repeating fields that contain arrays, individual items in the array can't be patched piecemeal; they must be supplied in the request body with the desired values for all items. See the user accounts guide for more information. (users.update)

watch(Channel $postBody, array $optParams = [])

Watches for changes in users list. (users.watch)

Details

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

Deletes a user. (users.delete)

Parameters

string $userKey

Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.

array $optParams

Optional parameters.

Exceptions

Exception

User get(string $userKey, array $optParams = [])

Retrieves a user. (users.get)

Parameters

string $userKey

Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.

array $optParams

Optional parameters.

Return Value

User

Exceptions

Exception

User insert(User $postBody, array $optParams = [])

Creates a user. Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case. If resolveConflictAccount is set to true, a 202 response code means that a conflicting unmanaged account exists and was invited to join the organization. A 409 response code means that a conflicting account exists so the user wasn't created based on the handling unmanaged user accounts option selected. (users.insert)

Parameters

User $postBody
array $optParams

Optional parameters.

Return Value

User

Exceptions

Exception

Users listUsers(array $optParams = [])

Retrieves a paginated list of either deleted users or all users in a domain.

(users.listUsers)

Parameters

array $optParams

Optional parameters.

Return Value

Users

Exceptions

Exception

makeAdmin(string $userKey, UserMakeAdmin $postBody, array $optParams = [])

Makes a user a super administrator. (users.makeAdmin)

Parameters

string $userKey

Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.

UserMakeAdmin $postBody
array $optParams

Optional parameters.

Exceptions

Exception

User patch(string $userKey, User $postBody, array $optParams = [])

Updates a user using patch semantics. The update method should be used instead, because it also supports patch semantics and has better performance.

If you're mapping an external identity to a Google identity, use the update method instead of the patch method. This method is unable to clear fields that contain repeated objects (addresses, phones, etc). Use the update method instead. (users.patch)

Parameters

string $userKey

Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.

User $postBody
array $optParams

Optional parameters.

Return Value

User

Exceptions

Exception

signOut(string $userKey, array $optParams = [])

Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again. (users.signOut)

Parameters

string $userKey

Identifies the target user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.

array $optParams

Optional parameters.

Exceptions

Exception

undelete(string $userKey, UserUndelete $postBody, array $optParams = [])

Undeletes a deleted user. (users.undelete)

Parameters

string $userKey

The immutable id of the user

UserUndelete $postBody
array $optParams

Optional parameters.

Exceptions

Exception

User update(string $userKey, User $postBody, array $optParams = [])

Updates a user. This method supports patch semantics, meaning that you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to null will be cleared. For repeating fields that contain arrays, individual items in the array can't be patched piecemeal; they must be supplied in the request body with the desired values for all items. See the user accounts guide for more information. (users.update)

Parameters

string $userKey

Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.

User $postBody
array $optParams

Optional parameters.

Return Value

User

Exceptions

Exception

Channel watch(Channel $postBody, array $optParams = [])

Watches for changes in users list. (users.watch)

Parameters

Channel $postBody
array $optParams

Optional parameters.

Return Value

Channel

Exceptions

Exception