Class AlertRuleLeafCondition

java.lang.Object
com.azure.resourcemanager.monitor.models.AlertRuleLeafCondition
All Implemented Interfaces:
com.azure.json.JsonSerializable<AlertRuleLeafCondition>
Direct Known Subclasses:
ActivityLogAlertLeafCondition

public class AlertRuleLeafCondition extends Object implements com.azure.json.JsonSerializable<AlertRuleLeafCondition>
An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event. This condition must contain 'field' and either 'equals' or 'containsAny'.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of AlertRuleLeafCondition class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the containsAny property: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.
    Get the equals property: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.
    Get the field property: The name of the Activity Log event's field that this condition will examine.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of AlertRuleLeafCondition from the JsonReader.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withContainsAny(List<String> containsAny)
    Set the containsAny property: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.
    Set the equals property: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.
    Set the field property: The name of the Activity Log event's field that this condition will examine.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • AlertRuleLeafCondition

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

    • field

      public String field()
      Get the field property: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'.
      Returns:
      the field value.
    • withField

      public AlertRuleLeafCondition withField(String field)
      Set the field property: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'.
      Parameters:
      field - the field value to set.
      Returns:
      the AlertRuleLeafCondition object itself.
    • equals

      public String equals()
      Get the equals property: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.
      Returns:
      the equals value.
    • withEquals

      public AlertRuleLeafCondition withEquals(String equals)
      Set the equals property: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.
      Parameters:
      equals - the equals value to set.
      Returns:
      the AlertRuleLeafCondition object itself.
    • containsAny

      public List<String> containsAny()
      Get the containsAny property: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.
      Returns:
      the containsAny value.
    • withContainsAny

      public AlertRuleLeafCondition withContainsAny(List<String> containsAny)
      Set the containsAny property: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.
      Parameters:
      containsAny - the containsAny value to set.
      Returns:
      the AlertRuleLeafCondition 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<AlertRuleLeafCondition>
      Throws:
      IOException
    • fromJson

      public static AlertRuleLeafCondition fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of AlertRuleLeafCondition from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of AlertRuleLeafCondition 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 AlertRuleLeafCondition.