patch method

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

Updates a log scope.

request - The metadata request object.

Request parameters:

name - Output only. The resource name of the log scope.Log scopes are only available in the global location. For example:projects/my-project/locations/global/logScopes/my-log-scope Value must have pattern ^folders/\[^/\]+/locations/\[^/\]+/logScopes/\[^/\]+$.

updateMask - Optional. Field mask that specifies the fields in log_scope that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=description

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

Completes with a LogScope.

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<LogScope> patch(
  LogScope 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_ = 'v2/' + core.Uri.encodeFull('$name');

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