// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.security.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the
 * event model to an expected value. This comparison is done by using one of the supported operators set.
 */
@Fluent
public final class AutomationTriggeringRule {
    /*
     * The JPath of the entity model property that should be checked.
     */
    @JsonProperty(value = "propertyJPath")
    private String propertyJPath;

    /*
     * The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]
     */
    @JsonProperty(value = "propertyType")
    private PropertyType propertyType;

    /*
     * The expected value.
     */
    @JsonProperty(value = "expectedValue")
    private String expectedValue;

    /*
     * A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType.
     */
    @JsonProperty(value = "operator")
    private Operator operator;

    /** Creates an instance of AutomationTriggeringRule class. */
    public AutomationTriggeringRule() {
    }

    /**
     * Get the propertyJPath property: The JPath of the entity model property that should be checked.
     *
     * @return the propertyJPath value.
     */
    public String propertyJPath() {
        return this.propertyJPath;
    }

    /**
     * Set the propertyJPath property: The JPath of the entity model property that should be checked.
     *
     * @param propertyJPath the propertyJPath value to set.
     * @return the AutomationTriggeringRule object itself.
     */
    public AutomationTriggeringRule withPropertyJPath(String propertyJPath) {
        this.propertyJPath = propertyJPath;
        return this;
    }

    /**
     * Get the propertyType property: The data type of the compared operands (string, integer, floating point number or
     * a boolean [true/false]].
     *
     * @return the propertyType value.
     */
    public PropertyType propertyType() {
        return this.propertyType;
    }

    /**
     * Set the propertyType property: The data type of the compared operands (string, integer, floating point number or
     * a boolean [true/false]].
     *
     * @param propertyType the propertyType value to set.
     * @return the AutomationTriggeringRule object itself.
     */
    public AutomationTriggeringRule withPropertyType(PropertyType propertyType) {
        this.propertyType = propertyType;
        return this;
    }

    /**
     * Get the expectedValue property: The expected value.
     *
     * @return the expectedValue value.
     */
    public String expectedValue() {
        return this.expectedValue;
    }

    /**
     * Set the expectedValue property: The expected value.
     *
     * @param expectedValue the expectedValue value to set.
     * @return the AutomationTriggeringRule object itself.
     */
    public AutomationTriggeringRule withExpectedValue(String expectedValue) {
        this.expectedValue = expectedValue;
        return this;
    }

    /**
     * Get the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for
     * String PropertyType.
     *
     * @return the operator value.
     */
    public Operator operator() {
        return this.operator;
    }

    /**
     * Set the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for
     * String PropertyType.
     *
     * @param operator the operator value to set.
     * @return the AutomationTriggeringRule object itself.
     */
    public AutomationTriggeringRule withOperator(Operator operator) {
        this.operator = operator;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
