patch method

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

Update the specified case.

Only a subset of fields (display_name, description, time_zone, subscriber_email_addresses, related_resources, severity, priority, primary_contact, and labels) can be updated.

request - The metadata request object.

Request parameters:

name - The resource name for the case. Value must have pattern ^\[^/\]+/\[^/\]+/cases/\[^/\]+$.

updateMask - A field that represents attributes of a case object that should be updated as part of this request. Supported values are severity, display_name, and subscriber_email_addresses. If no fields are specified, all supported fields will be updated. WARNING: If you do not provide a field mask then you may accidentally clear some fields. For example, if you leave field mask empty and do not provide a value for subscriber_email_addresses then subscriber_email_addresses will be updated to empty.

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

Completes with a Case.

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

  final _response = await _requester.request(
    _url,
    'PATCH',
    body: _body,
    queryParams: _queryParams,
  );
  return Case.fromJson(_response as core.Map<core.String, core.dynamic>);
}