patch method

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

Updates an Uptime check configuration.

You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via updateMask. Returns the updated configuration.

request - The metadata request object.

Request parameters:

name - Identifier. A unique resource name for this Uptime check configuration. The format is: projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the Uptime check.This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response. Value must have pattern ^projects/\[^/\]+/uptimeCheckConfigs/\[^/\]+$.

updateMask - Optional. If present, only the listed fields in the current Uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration.

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

Completes with a UptimeCheckConfig.

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

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