java.lang.Object
com.azure.resourcemanager.security.models.Rule

public final class Rule extends Object
Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote addresses are recommended to be blocked.
  • Constructor Details

    • Rule

      public Rule()
  • Method Details

    • name

      public String name()
      Get the name property: The name of the rule.
      Returns:
      the name value.
    • withName

      public Rule withName(String name)
      Set the name property: The name of the rule.
      Parameters:
      name - the name value to set.
      Returns:
      the Rule object itself.
    • direction

      public Direction direction()
      Get the direction property: The rule's direction.
      Returns:
      the direction value.
    • withDirection

      public Rule withDirection(Direction direction)
      Set the direction property: The rule's direction.
      Parameters:
      direction - the direction value to set.
      Returns:
      the Rule object itself.
    • destinationPort

      public Integer destinationPort()
      Get the destinationPort property: The rule's destination port.
      Returns:
      the destinationPort value.
    • withDestinationPort

      public Rule withDestinationPort(Integer destinationPort)
      Set the destinationPort property: The rule's destination port.
      Parameters:
      destinationPort - the destinationPort value to set.
      Returns:
      the Rule object itself.
    • protocols

      public List<TransportProtocol> protocols()
      Get the protocols property: The rule's transport protocols.
      Returns:
      the protocols value.
    • withProtocols

      public Rule withProtocols(List<TransportProtocol> protocols)
      Set the protocols property: The rule's transport protocols.
      Parameters:
      protocols - the protocols value to set.
      Returns:
      the Rule object itself.
    • ipAddresses

      public List<String> ipAddresses()
      Get the ipAddresses property: The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol.
      Returns:
      the ipAddresses value.
    • withIpAddresses

      public Rule withIpAddresses(List<String> ipAddresses)
      Set the ipAddresses property: The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol.
      Parameters:
      ipAddresses - the ipAddresses value to set.
      Returns:
      the Rule object itself.
    • validate

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