// 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.resourcemanager.securityinsights.fluent.models.EntityQueryInner;
import com.azure.resourcemanager.securityinsights.fluent.models.ExpansionEntityQueriesProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Represents Expansion entity query. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("Expansion")
@Fluent
public final class ExpansionEntityQuery extends EntityQueryInner {
    /*
     * Expansion entity query properties
     */
    @JsonProperty(value = "properties")
    private ExpansionEntityQueriesProperties innerProperties;

    /**
     * Get the innerProperties property: Expansion entity query properties.
     *
     * @return the innerProperties value.
     */
    private ExpansionEntityQueriesProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public ExpansionEntityQuery withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /**
     * Get the dataSources property: List of the data sources that are required to run the query.
     *
     * @return the dataSources value.
     */
    public List<String> dataSources() {
        return this.innerProperties() == null ? null : this.innerProperties().dataSources();
    }

    /**
     * Set the dataSources property: List of the data sources that are required to run the query.
     *
     * @param dataSources the dataSources value to set.
     * @return the ExpansionEntityQuery object itself.
     */
    public ExpansionEntityQuery withDataSources(List<String> dataSources) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExpansionEntityQueriesProperties();
        }
        this.innerProperties().withDataSources(dataSources);
        return this;
    }

    /**
     * Get the displayName property: The query display name.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: The query display name.
     *
     * @param displayName the displayName value to set.
     * @return the ExpansionEntityQuery object itself.
     */
    public ExpansionEntityQuery withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExpansionEntityQueriesProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the inputEntityType property: The type of the query's source entity.
     *
     * @return the inputEntityType value.
     */
    public EntityType inputEntityType() {
        return this.innerProperties() == null ? null : this.innerProperties().inputEntityType();
    }

    /**
     * Set the inputEntityType property: The type of the query's source entity.
     *
     * @param inputEntityType the inputEntityType value to set.
     * @return the ExpansionEntityQuery object itself.
     */
    public ExpansionEntityQuery withInputEntityType(EntityType inputEntityType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExpansionEntityQueriesProperties();
        }
        this.innerProperties().withInputEntityType(inputEntityType);
        return this;
    }

    /**
     * Get the inputFields property: List of the fields of the source entity that are required to run the query.
     *
     * @return the inputFields value.
     */
    public List<String> inputFields() {
        return this.innerProperties() == null ? null : this.innerProperties().inputFields();
    }

    /**
     * Set the inputFields property: List of the fields of the source entity that are required to run the query.
     *
     * @param inputFields the inputFields value to set.
     * @return the ExpansionEntityQuery object itself.
     */
    public ExpansionEntityQuery withInputFields(List<String> inputFields) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExpansionEntityQueriesProperties();
        }
        this.innerProperties().withInputFields(inputFields);
        return this;
    }

    /**
     * Get the outputEntityTypes property: List of the desired output types to be constructed from the result.
     *
     * @return the outputEntityTypes value.
     */
    public List<EntityType> outputEntityTypes() {
        return this.innerProperties() == null ? null : this.innerProperties().outputEntityTypes();
    }

    /**
     * Set the outputEntityTypes property: List of the desired output types to be constructed from the result.
     *
     * @param outputEntityTypes the outputEntityTypes value to set.
     * @return the ExpansionEntityQuery object itself.
     */
    public ExpansionEntityQuery withOutputEntityTypes(List<EntityType> outputEntityTypes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExpansionEntityQueriesProperties();
        }
        this.innerProperties().withOutputEntityTypes(outputEntityTypes);
        return this;
    }

    /**
     * Get the queryTemplate property: The template query string to be parsed and formatted.
     *
     * @return the queryTemplate value.
     */
    public String queryTemplate() {
        return this.innerProperties() == null ? null : this.innerProperties().queryTemplate();
    }

    /**
     * Set the queryTemplate property: The template query string to be parsed and formatted.
     *
     * @param queryTemplate the queryTemplate value to set.
     * @return the ExpansionEntityQuery object itself.
     */
    public ExpansionEntityQuery withQueryTemplate(String queryTemplate) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExpansionEntityQueriesProperties();
        }
        this.innerProperties().withQueryTemplate(queryTemplate);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
