patch method

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

Updates the specified Version resource.

Currently the only update-able fields are description, requestLoggingConfig, autoScaling.minNodes, and manualScaling.nodes.

request - The metadata request object.

Request parameters:

name - Required. The name of the model. Value must have pattern ^projects/\[^/\]+/models/\[^/\]+/versions/\[^/\]+$.

updateMask - Required. Specifies the path, relative to Version, of the field to update. Must be present and non-empty. For example, to change the description of a version to "foo", the update_mask parameter would be specified as description, and the PATCH request body would specify the new value, as follows: { "description": "foo" } Currently the only supported update mask fields are description, requestLoggingConfig, autoScaling.minNodes, and manualScaling.nodes. However, you can only update manualScaling.nodes if the version uses a [Compute Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction).

$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(
  GoogleCloudMlV1Version 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>);
}