patch method
- CuratedPackage request,
- String name, {
- String? updateMask,
- String? $fields,
Updates an existing curated package.
request - The metadata request object.
Request parameters:
name - Identifier. The unique resource name for the curated package.
Format: curators/{accountId}/curatedPackages/{curatedPackageId}
Value must have pattern ^curators/\[^/\]+/curatedPackages/\[^/\]+$.
updateMask - Optional. List of fields to be updated. If empty or
unspecified, the service will update all fields populated in the update
request excluding the output only fields and primitive fields with default
value. Note that explicit field mask is required in order to reset a
primitive field back to its default value, for example, false for boolean
fields, 0 for integer fields. A special field mask consisting of a single
path "*" can be used to indicate full replacement (the equivalent of PUT
method), updatable fields unset or unspecified in the input will be
cleared or set to default value. Output only fields will be ignored
regardless of the value of updateMask.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a CuratedPackage.
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<CuratedPackage> patch(
CuratedPackage 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_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return CuratedPackage.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}