Class TrafficDetectionRule

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

public final class TrafficDetectionRule extends Object implements com.azure.json.JsonSerializable<TrafficDetectionRule>
Ddos Custom Policy traffic detection rule.
  • Constructor Details

    • TrafficDetectionRule

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

    • trafficType

      public DdosTrafficType trafficType()
      Get the trafficType property: The traffic type (one of Tcp, Udp, TcpSyn) that the detection rule will be applied upon.
      Returns:
      the trafficType value.
    • withTrafficType

      public TrafficDetectionRule withTrafficType(DdosTrafficType trafficType)
      Set the trafficType property: The traffic type (one of Tcp, Udp, TcpSyn) that the detection rule will be applied upon.
      Parameters:
      trafficType - the trafficType value to set.
      Returns:
      the TrafficDetectionRule object itself.
    • packetsPerSecond

      public Integer packetsPerSecond()
      Get the packetsPerSecond property: The customized packets per second threshold.
      Returns:
      the packetsPerSecond value.
    • withPacketsPerSecond

      public TrafficDetectionRule withPacketsPerSecond(Integer packetsPerSecond)
      Set the packetsPerSecond property: The customized packets per second threshold.
      Parameters:
      packetsPerSecond - the packetsPerSecond value to set.
      Returns:
      the TrafficDetectionRule 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<TrafficDetectionRule>
      Throws:
      IOException
    • fromJson

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