patch method
Updates a folder, changing its display_name
.
Changes to the folder display_name
will be rejected if they violate
either the display_name
formatting rules or the naming constraints
described in the CreateFolder documentation. The folder's display_name
must start and end with a letter or digit, may contain letters, digits,
spaces, hyphens and underscores and can be between 3 and 30 characters.
This is captured by the regular expression:
\p{L}\p{N}{1,28}[\p{L}\p{N}]
. The caller must have
resourcemanager.folders.update
permission on the identified folder. If
the update fails due to the unique name constraint then a
PreconditionFailure
explaining this violation will be returned in the
Status.details field.
request
- The metadata request object.
Request parameters:
name
- Output only. The resource name of the folder. Its format is
folders/{folder_id}
, for example: "folders/1234".
Value must have pattern ^folders/\[^/\]+$
.
updateMask
- Required. Fields to be updated. Only the display_name
can
be updated.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Operation.
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<Operation> patch(
Folder 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_ = 'v3/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}