Class WebApplicationFirewallCustomRule

java.lang.Object
com.azure.resourcemanager.network.models.WebApplicationFirewallCustomRule
All Implemented Interfaces:
com.azure.json.JsonSerializable<WebApplicationFirewallCustomRule>

public final class WebApplicationFirewallCustomRule extends Object implements com.azure.json.JsonSerializable<WebApplicationFirewallCustomRule>
Defines contents of a web application rule.
  • Constructor Details

    • WebApplicationFirewallCustomRule

      public WebApplicationFirewallCustomRule()
      Creates an instance of WebApplicationFirewallCustomRule class.
  • Method Details

    • name

      public String name()
      Get the name property: The name of the resource that is unique within a policy. This name can be used to access the resource.
      Returns:
      the name value.
    • withName

      public WebApplicationFirewallCustomRule withName(String name)
      Set the name property: The name of the resource that is unique within a policy. This name can be used to access the resource.
      Parameters:
      name - the name value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • etag

      public String etag()
      Get the etag property: A unique read-only string that changes whenever the resource is updated.
      Returns:
      the etag value.
    • priority

      public int priority()
      Get the priority property: Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
      Returns:
      the priority value.
    • withPriority

      public WebApplicationFirewallCustomRule withPriority(int priority)
      Set the priority property: Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
      Parameters:
      priority - the priority value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • state

      Get the state property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
      Returns:
      the state value.
    • withState

      Set the state property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
      Parameters:
      state - the state value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • rateLimitDuration

      public ApplicationGatewayFirewallRateLimitDuration rateLimitDuration()
      Get the rateLimitDuration property: Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
      Returns:
      the rateLimitDuration value.
    • withRateLimitDuration

      public WebApplicationFirewallCustomRule withRateLimitDuration(ApplicationGatewayFirewallRateLimitDuration rateLimitDuration)
      Set the rateLimitDuration property: Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
      Parameters:
      rateLimitDuration - the rateLimitDuration value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • rateLimitThreshold

      public Integer rateLimitThreshold()
      Get the rateLimitThreshold property: Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be greater than or equal to 1.
      Returns:
      the rateLimitThreshold value.
    • withRateLimitThreshold

      public WebApplicationFirewallCustomRule withRateLimitThreshold(Integer rateLimitThreshold)
      Set the rateLimitThreshold property: Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be greater than or equal to 1.
      Parameters:
      rateLimitThreshold - the rateLimitThreshold value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • ruleType

      public WebApplicationFirewallRuleType ruleType()
      Get the ruleType property: The rule type.
      Returns:
      the ruleType value.
    • withRuleType

      Set the ruleType property: The rule type.
      Parameters:
      ruleType - the ruleType value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • matchConditions

      public List<MatchCondition> matchConditions()
      Get the matchConditions property: List of match conditions.
      Returns:
      the matchConditions value.
    • withMatchConditions

      public WebApplicationFirewallCustomRule withMatchConditions(List<MatchCondition> matchConditions)
      Set the matchConditions property: List of match conditions.
      Parameters:
      matchConditions - the matchConditions value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • groupByUserSession

      public List<GroupByUserSession> groupByUserSession()
      Get the groupByUserSession property: List of user session identifier group by clauses.
      Returns:
      the groupByUserSession value.
    • withGroupByUserSession

      public WebApplicationFirewallCustomRule withGroupByUserSession(List<GroupByUserSession> groupByUserSession)
      Set the groupByUserSession property: List of user session identifier group by clauses.
      Parameters:
      groupByUserSession - the groupByUserSession value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • action

      Get the action property: Type of Actions.
      Returns:
      the action value.
    • withAction

      Set the action property: Type of Actions.
      Parameters:
      action - the action value to set.
      Returns:
      the WebApplicationFirewallCustomRule object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<WebApplicationFirewallCustomRule>
      Throws:
      IOException
    • fromJson

      public static WebApplicationFirewallCustomRule fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of WebApplicationFirewallCustomRule from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of WebApplicationFirewallCustomRule if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the WebApplicationFirewallCustomRule.