patch method

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

Updates a single connection.

request - The metadata request object.

Request parameters:

name - Immutable. The resource name of the connection, in the format projects/{project}/locations/{location}/connections/{connection_id}. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$.

allowMissing - If set to true, and the connection is not found a new connection will be created. In this situation update_mask is ignored. The creation will succeed only if the input connection has all the necessary information (e.g a github_config with both user_oauth_token and installation_id properties).

etag - The current etag of the connection. If an etag is provided and does not match the current etag of the connection, update will be blocked and an ABORTED error will be returned.

updateMask - The list of fields to be updated.

$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(
  Connection request,
  core.String name, {
  core.bool? allowMissing,
  core.String? etag,
  core.String? updateMask,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (allowMissing != null) 'allowMissing': ['${allowMissing}'],
    if (etag != null) 'etag': [etag],
    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 Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}