update method
Updates a managed folder using patch semantics.
request - The metadata request object.
Request parameters:
bucket - The name of the bucket containing the managed folder.
managedFolder - The name of the managed folder.
ifMetagenerationMatch - Makes the operation conditional on whether the
metageneration of the managed folder matches the specified value.
ifMetagenerationNotMatch - Makes the operation conditional on whether
the metageneration of the managed folder doesn't match the specified
value.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ManagedFolder.
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<ManagedFolder> update(
ManagedFolder request,
core.String bucket,
core.String managedFolder, {
core.String? ifMetagenerationMatch,
core.String? ifMetagenerationNotMatch,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'ifMetagenerationMatch': ?ifMetagenerationMatch == null
? null
: [ifMetagenerationMatch],
'ifMetagenerationNotMatch': ?ifMetagenerationNotMatch == null
? null
: [ifMetagenerationNotMatch],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'b/' +
commons.escapeVariable('$bucket') +
'/managedFolders/' +
commons.escapeVariable('$managedFolder');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return ManagedFolder.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}