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

package com.azure.resourcemanager.automation.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Group specific to the update configuration. */
@Fluent
public final class TargetProperties {
    /*
     * List of Azure queries in the software update configuration.
     */
    @JsonProperty(value = "azureQueries")
    private List<AzureQueryProperties> azureQueries;

    /*
     * List of non Azure queries in the software update configuration.
     */
    @JsonProperty(value = "nonAzureQueries")
    private List<NonAzureQueryProperties> nonAzureQueries;

    /**
     * Get the azureQueries property: List of Azure queries in the software update configuration.
     *
     * @return the azureQueries value.
     */
    public List<AzureQueryProperties> azureQueries() {
        return this.azureQueries;
    }

    /**
     * Set the azureQueries property: List of Azure queries in the software update configuration.
     *
     * @param azureQueries the azureQueries value to set.
     * @return the TargetProperties object itself.
     */
    public TargetProperties withAzureQueries(List<AzureQueryProperties> azureQueries) {
        this.azureQueries = azureQueries;
        return this;
    }

    /**
     * Get the nonAzureQueries property: List of non Azure queries in the software update configuration.
     *
     * @return the nonAzureQueries value.
     */
    public List<NonAzureQueryProperties> nonAzureQueries() {
        return this.nonAzureQueries;
    }

    /**
     * Set the nonAzureQueries property: List of non Azure queries in the software update configuration.
     *
     * @param nonAzureQueries the nonAzureQueries value to set.
     * @return the TargetProperties object itself.
     */
    public TargetProperties withNonAzureQueries(List<NonAzureQueryProperties> nonAzureQueries) {
        this.nonAzureQueries = nonAzureQueries;
        return this;
    }

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