patch method

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

Updates an existing client.

request - The metadata request object.

Request parameters:

name - Output only. The resource name of the client. Format: buyers/{accountId}/clients/{clientAccountId} Value must have pattern ^buyers/\[^/\]+/clients/\[^/\]+$.

updateMask - List of fields to be updated. If empty or unspecified, the service will update all fields populated in the update request excluding the output only fields and primitive fields with default value. Note that explicit field mask is required in order to reset a primitive field back to its default value, for example, false for boolean fields, 0 for integer fields. A special field mask consisting of a single path "*" can be used to indicate full replacement(the equivalent of PUT method), updatable fields unset or unspecified in the input will be cleared or set to default value. Output only fields will be ignored regardless of the value of updateMask.

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

Completes with a Client.

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