patch method
Developer Preview: Updates a user for a domain.
Only Owners and Admins can execute this RPC, only a user's domain permission will be allowed to be updated. Returns NOT_FOUND if the user does not exist. Returns INVALID_ARGUMENT if a permission is not provided or is PERMISSION_UNSPECIFIED, NONE, or OWNER.
request - The metadata request object.
Request parameters:
name - Identifier. The resource name of the user. Format: users/{user}
Note: {user} is the user's email address.
Value must have pattern ^domains/\[^/\]+/users/\[^/\]+$.
updateMask - The list of fields to update.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a User.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<User> patch(
User request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return User.fromJson(response_ as core.Map<core.String, core.dynamic>);
}