patch method
Updates the definition of a custom Role.
request
- The metadata request object.
Request parameters:
name
- The name
parameter's value depends on the target resource for
the request, namely
projects
or
organizations.
Each resource type's name
value format is described below: *
projects.roles.patch:
projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}
. This method updates only
custom roles
that have been created at the project level. Example request URL:
https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}
*
organizations.roles.patch:
organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}
. This method
updates only
custom roles
that have been created at the organization level. Example request URL:
https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}
Note: Wildcard (*) values are invalid; you must specify a complete project
ID or organization ID.
Value must have pattern ^projects/\[^/\]+/roles/\[^/\]+$
.
updateMask
- A mask describing which fields in the Role have changed.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Role.
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<Role> patch(
Role 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>>{
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Role.fromJson(response_ as core.Map<core.String, core.dynamic>);
}