patch method

Future<Operation> patch(
  1. TagKey request,
  2. String name, {
  3. String? updateMask,
  4. bool? validateOnly,
  5. String? $fields,
})

Updates the attributes of the TagKey resource.

request - The metadata request object.

Request parameters:

name - Immutable. The resource name for a TagKey. Must be in the format tagKeys/{tag_key_id}, where tag_key_id is the generated numeric id for the TagKey. Value must have pattern ^tagKeys/\[^/\]+$.

updateMask - Fields to be updated. The mask may only contain description or etag. If omitted entirely, both description and etag are assumed to be significant.

validateOnly - Set as true to perform validations necessary for updating the resource, but not actually perform the action.

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

Completes with a Operation.

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<Operation> patch(
  TagKey request,
  core.String name, {
  core.String? updateMask,
  core.bool? validateOnly,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (updateMask != null) 'updateMask': [updateMask],
    if (validateOnly != null) 'validateOnly': ['${validateOnly}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v3/' + core.Uri.encodeFull('$name');

  final response_ = await _requester.request(
    url_,
    'PATCH',
    body: body_,
    queryParams: queryParams_,
  );
  return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}