// 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.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The insight table query. */
@Fluent
public final class InsightQueryItemPropertiesTableQuery {
    /*
     * List of insight column definitions.
     */
    @JsonProperty(value = "columnsDefinitions")
    private List<InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem> columnsDefinitions;

    /*
     * List of insight queries definitions.
     */
    @JsonProperty(value = "queriesDefinitions")
    private List<InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem> queriesDefinitions;

    /**
     * Get the columnsDefinitions property: List of insight column definitions.
     *
     * @return the columnsDefinitions value.
     */
    public List<InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem> columnsDefinitions() {
        return this.columnsDefinitions;
    }

    /**
     * Set the columnsDefinitions property: List of insight column definitions.
     *
     * @param columnsDefinitions the columnsDefinitions value to set.
     * @return the InsightQueryItemPropertiesTableQuery object itself.
     */
    public InsightQueryItemPropertiesTableQuery withColumnsDefinitions(
        List<InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem> columnsDefinitions) {
        this.columnsDefinitions = columnsDefinitions;
        return this;
    }

    /**
     * Get the queriesDefinitions property: List of insight queries definitions.
     *
     * @return the queriesDefinitions value.
     */
    public List<InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem> queriesDefinitions() {
        return this.queriesDefinitions;
    }

    /**
     * Set the queriesDefinitions property: List of insight queries definitions.
     *
     * @param queriesDefinitions the queriesDefinitions value to set.
     * @return the InsightQueryItemPropertiesTableQuery object itself.
     */
    public InsightQueryItemPropertiesTableQuery withQueriesDefinitions(
        List<InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem> queriesDefinitions) {
        this.queriesDefinitions = queriesDefinitions;
        return this;
    }

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