patch method
- GoogleCloudMlV1Job request,
- String name, {
- String? updateMask,
- String? $fields,
Updates a specific job resource.
Currently the only supported fields to update are labels
.
request
- The metadata request object.
Request parameters:
name
- Required. The job name.
Value must have pattern ^projects/\[^/\]+/jobs/\[^/\]+$
.
updateMask
- Required. Specifies the path, relative to Job
, of the
field to update. To adopt etag mechanism, include etag
field in the
mask, and include the etag
value in your job resource. For example, to
change the labels of a job, the update_mask
parameter would be specified
as labels
, etag
, and the PATCH
request body would specify the new
value, as follows: { "labels": { "owner": "Google", "color": "Blue" }
"etag": "33a64df551425fcc55e4d42a148795d9f25f89d4" } If etag
matches the
one on the server, the labels of the job will be replaced with the given
ones, and the server end etag
will be recalculated. Currently the only
supported update masks are labels
and etag
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudMlV1Job.
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<GoogleCloudMlV1Job> patch(
GoogleCloudMlV1Job 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 GoogleCloudMlV1Job.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}