patch method

Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<Operation> patch(PatchSubnetworkRequest request) async {
  final url = _endPoint.replace(
    path:
        '/compute/v1/projects/${request.project}/regions/${request.region}/subnetworks/${request.subnetwork}',
    queryParameters: {
      if (request.drainTimeoutSeconds case final $1?)
        'drainTimeoutSeconds': '${$1}',
      'requestId': ?request.requestId,
    },
  );
  final response = await _client.patch(url, body: request.subnetworkResource);
  return Operation.fromJson(response);
}