All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesChangedCondition Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09.

There is a newer version: 1.0.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
 * The AutomationRulePropertyValuesChangedCondition model.
 */
@Fluent
public final class AutomationRulePropertyValuesChangedCondition
    implements JsonSerializable {
    /*
     * The propertyName property.
     */
    private AutomationRulePropertyChangedConditionSupportedPropertyType propertyName;

    /*
     * The changeType property.
     */
    private AutomationRulePropertyChangedConditionSupportedChangedType changeType;

    /*
     * The operator property.
     */
    private AutomationRulePropertyConditionSupportedOperator operator;

    /*
     * The propertyValues property.
     */
    private List propertyValues;

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

    /**
     * Get the propertyName property: The propertyName property.
     * 
     * @return the propertyName value.
     */
    public AutomationRulePropertyChangedConditionSupportedPropertyType propertyName() {
        return this.propertyName;
    }

    /**
     * Set the propertyName property: The propertyName property.
     * 
     * @param propertyName the propertyName value to set.
     * @return the AutomationRulePropertyValuesChangedCondition object itself.
     */
    public AutomationRulePropertyValuesChangedCondition
        withPropertyName(AutomationRulePropertyChangedConditionSupportedPropertyType propertyName) {
        this.propertyName = propertyName;
        return this;
    }

    /**
     * Get the changeType property: The changeType property.
     * 
     * @return the changeType value.
     */
    public AutomationRulePropertyChangedConditionSupportedChangedType changeType() {
        return this.changeType;
    }

    /**
     * Set the changeType property: The changeType property.
     * 
     * @param changeType the changeType value to set.
     * @return the AutomationRulePropertyValuesChangedCondition object itself.
     */
    public AutomationRulePropertyValuesChangedCondition
        withChangeType(AutomationRulePropertyChangedConditionSupportedChangedType changeType) {
        this.changeType = changeType;
        return this;
    }

    /**
     * Get the operator property: The operator property.
     * 
     * @return the operator value.
     */
    public AutomationRulePropertyConditionSupportedOperator operator() {
        return this.operator;
    }

    /**
     * Set the operator property: The operator property.
     * 
     * @param operator the operator value to set.
     * @return the AutomationRulePropertyValuesChangedCondition object itself.
     */
    public AutomationRulePropertyValuesChangedCondition
        withOperator(AutomationRulePropertyConditionSupportedOperator operator) {
        this.operator = operator;
        return this;
    }

    /**
     * Get the propertyValues property: The propertyValues property.
     * 
     * @return the propertyValues value.
     */
    public List propertyValues() {
        return this.propertyValues;
    }

    /**
     * Set the propertyValues property: The propertyValues property.
     * 
     * @param propertyValues the propertyValues value to set.
     * @return the AutomationRulePropertyValuesChangedCondition object itself.
     */
    public AutomationRulePropertyValuesChangedCondition withPropertyValues(List propertyValues) {
        this.propertyValues = propertyValues;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("propertyName", this.propertyName == null ? null : this.propertyName.toString());
        jsonWriter.writeStringField("changeType", this.changeType == null ? null : this.changeType.toString());
        jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString());
        jsonWriter.writeArrayField("propertyValues", this.propertyValues,
            (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of AutomationRulePropertyValuesChangedCondition from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of AutomationRulePropertyValuesChangedCondition 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 AutomationRulePropertyValuesChangedCondition.
     */
    public static AutomationRulePropertyValuesChangedCondition fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            AutomationRulePropertyValuesChangedCondition deserializedAutomationRulePropertyValuesChangedCondition
                = new AutomationRulePropertyValuesChangedCondition();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("propertyName".equals(fieldName)) {
                    deserializedAutomationRulePropertyValuesChangedCondition.propertyName
                        = AutomationRulePropertyChangedConditionSupportedPropertyType.fromString(reader.getString());
                } else if ("changeType".equals(fieldName)) {
                    deserializedAutomationRulePropertyValuesChangedCondition.changeType
                        = AutomationRulePropertyChangedConditionSupportedChangedType.fromString(reader.getString());
                } else if ("operator".equals(fieldName)) {
                    deserializedAutomationRulePropertyValuesChangedCondition.operator
                        = AutomationRulePropertyConditionSupportedOperator.fromString(reader.getString());
                } else if ("propertyValues".equals(fieldName)) {
                    List propertyValues = reader.readArray(reader1 -> reader1.getString());
                    deserializedAutomationRulePropertyValuesChangedCondition.propertyValues = propertyValues;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAutomationRulePropertyValuesChangedCondition;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy