patch method

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

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(PatchSecurityPolicyRequest request) async {
  final url = _endPoint.replace(
    path:
        '/compute/v1/projects/${request.project}/global/securityPolicies/${request.securityPolicy}',
    queryParameters: {
      'requestId': ?request.requestId,
      'updateMask': ?request.updateMask,
    },
  );
  final response = await _client.patch(
    url,
    body: request.securityPolicyResource,
  );
  return Operation.fromJson(response);
}