@BetaApi
  public final Operation addRuleSecurityPolicy(
      ProjectGlobalSecurityPolicyName securityPolicy,
      SecurityPolicyRule securityPolicyRuleResource) {

    AddRuleSecurityPolicyHttpRequest request =
        AddRuleSecurityPolicyHttpRequest.newBuilder()
            .setSecurityPolicy(securityPolicy == null ? null : securityPolicy.toString())
            .setSecurityPolicyRuleResource(securityPolicyRuleResource)
            .build();
    return addRuleSecurityPolicy(request);
  }
@ BetaApi public final Operation addRuleSecurityPolicy ( ProjectGlobalSecurityPolicyName securityPolicy , SecurityPolicyRule securityPolicyRuleResource ) { AddRuleSecurityPolicyHttpRequest request = AddRuleSecurityPolicyHttpRequest . newBuilder ( ) . setSecurityPolicy ( securityPolicy == null ? null : securityPolicy . toString ( ) ) . setSecurityPolicyRuleResource ( securityPolicyRuleResource ) . build ( ) ; return addRuleSecurityPolicy ( request ) ; }
Inserts a rule into a security policy.

<p>Sample code:

<pre><code>
try (SecurityPolicyClient securityPolicyClient = SecurityPolicyClient.create()) {
ProjectGlobalSecurityPolicyName securityPolicy = ProjectGlobalSecurityPolicyName.of("[PROJECT]", "[SECURITY_POLICY]");
SecurityPolicyRule securityPolicyRuleResource = SecurityPolicyRule.newBuilder().build();
Operation response = securityPolicyClient.addRuleSecurityPolicy(securityPolicy, securityPolicyRuleResource);
}
</code></pre>

@param securityPolicy Name of the security policy to update.
@param securityPolicyRuleResource Represents a rule that describes one or more match conditions
along with the action to be taken when traffic matches this condition (allow or deny).
@throws com.google.api.gax.rpc.ApiException if the remote call fails