patch method

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

Update an operation in an API version.

The following fields in the ApiOperation resource can be updated: * details.description * details.documentation * details.http_operation.path

  • details.http_operation.method * details.deprecated * attributes The update_mask should be used to specify the fields being updated. An operation can be updated only if the operation was created via CreateApiOperation API. If the operation was created by parsing the spec, then it can be edited by updating the spec.

request - The metadata request object.

Request parameters:

name - Identifier. The name of the operation. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/operations/\[^/\]+$.

updateMask - Required. The list of fields to update.

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

Completes with a GoogleCloudApihubV1ApiOperation.

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