patch method

Future<GoogleLongrunningOperation> patch(
  1. GoogleCloudMlV1Model request,
  2. String name, {
  3. String? updateMask,
  4. String? $fields,
})

Updates a specific model resource.

Currently the only supported fields to update are description and default_version.name.

request - The metadata request object.

Request parameters:

name - Required. The project name. Value must have pattern ^projects/\[^/\]+/models/\[^/\]+$.

updateMask - Required. Specifies the path, relative to Model, of the field to update. For example, to change the description of a model to "foo" and set its default version to "version_1", the update_mask parameter would be specified as description, default_version.name, and the PATCH request body would specify the new value, as follows: { "description": "foo", "defaultVersion": { "name":"version_1" } } Currently the supported update masks are description and default_version.name.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleLongrunningOperation.

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<GoogleLongrunningOperation> patch(
  GoogleCloudMlV1Model 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 GoogleLongrunningOperation.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}