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

com.azure.resourcemanager.securityinsights.models.EntityQueryItemProperties 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;

/**
 * An properties abstract Query item for entity.
 */
@Fluent
public class EntityQueryItemProperties implements JsonSerializable {
    /*
     * Data types for template
     */
    private List dataTypes;

    /*
     * The type of the entity
     */
    private EntityType inputEntityType;

    /*
     * Data types for template
     */
    private List> requiredInputFieldsSets;

    /*
     * The query applied only to entities matching to all filters
     */
    private Object entitiesFilter;

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

    /**
     * Get the dataTypes property: Data types for template.
     * 
     * @return the dataTypes value.
     */
    public List dataTypes() {
        return this.dataTypes;
    }

    /**
     * Set the dataTypes property: Data types for template.
     * 
     * @param dataTypes the dataTypes value to set.
     * @return the EntityQueryItemProperties object itself.
     */
    public EntityQueryItemProperties withDataTypes(List dataTypes) {
        this.dataTypes = dataTypes;
        return this;
    }

    /**
     * Get the inputEntityType property: The type of the entity.
     * 
     * @return the inputEntityType value.
     */
    public EntityType inputEntityType() {
        return this.inputEntityType;
    }

    /**
     * Set the inputEntityType property: The type of the entity.
     * 
     * @param inputEntityType the inputEntityType value to set.
     * @return the EntityQueryItemProperties object itself.
     */
    public EntityQueryItemProperties withInputEntityType(EntityType inputEntityType) {
        this.inputEntityType = inputEntityType;
        return this;
    }

    /**
     * Get the requiredInputFieldsSets property: Data types for template.
     * 
     * @return the requiredInputFieldsSets value.
     */
    public List> requiredInputFieldsSets() {
        return this.requiredInputFieldsSets;
    }

    /**
     * Set the requiredInputFieldsSets property: Data types for template.
     * 
     * @param requiredInputFieldsSets the requiredInputFieldsSets value to set.
     * @return the EntityQueryItemProperties object itself.
     */
    public EntityQueryItemProperties withRequiredInputFieldsSets(List> requiredInputFieldsSets) {
        this.requiredInputFieldsSets = requiredInputFieldsSets;
        return this;
    }

    /**
     * Get the entitiesFilter property: The query applied only to entities matching to all filters.
     * 
     * @return the entitiesFilter value.
     */
    public Object entitiesFilter() {
        return this.entitiesFilter;
    }

    /**
     * Set the entitiesFilter property: The query applied only to entities matching to all filters.
     * 
     * @param entitiesFilter the entitiesFilter value to set.
     * @return the EntityQueryItemProperties object itself.
     */
    public EntityQueryItemProperties withEntitiesFilter(Object entitiesFilter) {
        this.entitiesFilter = entitiesFilter;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (dataTypes() != null) {
            dataTypes().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeArrayField("dataTypes", this.dataTypes, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeStringField("inputEntityType",
            this.inputEntityType == null ? null : this.inputEntityType.toString());
        jsonWriter.writeArrayField("requiredInputFieldsSets", this.requiredInputFieldsSets,
            (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1)));
        jsonWriter.writeUntypedField("entitiesFilter", this.entitiesFilter);
        return jsonWriter.writeEndObject();
    }

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

                if ("dataTypes".equals(fieldName)) {
                    List dataTypes
                        = reader.readArray(reader1 -> EntityQueryItemPropertiesDataTypesItem.fromJson(reader1));
                    deserializedEntityQueryItemProperties.dataTypes = dataTypes;
                } else if ("inputEntityType".equals(fieldName)) {
                    deserializedEntityQueryItemProperties.inputEntityType = EntityType.fromString(reader.getString());
                } else if ("requiredInputFieldsSets".equals(fieldName)) {
                    List> requiredInputFieldsSets
                        = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString()));
                    deserializedEntityQueryItemProperties.requiredInputFieldsSets = requiredInputFieldsSets;
                } else if ("entitiesFilter".equals(fieldName)) {
                    deserializedEntityQueryItemProperties.entitiesFilter = reader.readUntyped();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedEntityQueryItemProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy