patch method

Future<GoogleLongrunningOperation> patch(
  1. GoogleCloudRunV2WorkerPool request,
  2. String name, {
  3. bool? allowMissing,
  4. bool? forceNewRevision,
  5. String? updateMask,
  6. bool? validateOnly,
  7. String? $fields,
})

Updates a WorkerPool.

request - The metadata request object.

Request parameters:

name - The fully qualified name of this WorkerPool. In CreateWorkerPoolRequest, this field is ignored, and instead composed from CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id. Format: projects/{project}/locations/{location}/workerPools/{worker_id} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/workerPools/\[^/\]+$.

allowMissing - Optional. If set to true, and if the WorkerPool does not exist, it will create a new one. The caller must have 'run.workerpools.create' permissions if this is set to true and the WorkerPool does not exist.

forceNewRevision - Optional. If set to true, a new revision will be created from the template even if the system doesn't detect any changes from the previously deployed revision. This may be useful for cases where the underlying resources need to be recreated or reinitialized. For example if the image is specified by label, but the underlying image digest has changed) or if the container performs deployment initialization work that needs to be performed again.

updateMask - Optional. The list of fields to be updated.

validateOnly - Optional. Indicates that the request should be validated and default values populated, without persisting the request or updating any resources.

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

Completes with a GoogleLongrunningOperation.

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<GoogleLongrunningOperation> patch(
  GoogleCloudRunV2WorkerPool request,
  core.String name, {
  core.bool? allowMissing,
  core.bool? forceNewRevision,
  core.String? updateMask,
  core.bool? validateOnly,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (allowMissing != null) 'allowMissing': ['${allowMissing}'],
    if (forceNewRevision != null) 'forceNewRevision': ['${forceNewRevision}'],
    if (updateMask != null) 'updateMask': [updateMask],
    if (validateOnly != null) 'validateOnly': ['${validateOnly}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/' + core.Uri.encodeFull('$name');

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