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

package com.azure.resourcemanager.workloads.models;

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

/**
 * The full resource names object for application layer resources. The number of entries in this list should be equal to
 * the number VMs to be created for application layer.
 */
@Fluent
public final class ApplicationServerFullResourceNames {
    /*
     * The list of virtual machine naming details.
     */
    @JsonProperty(value = "virtualMachines")
    private List<VirtualMachineResourceNames> virtualMachines;

    /*
     * The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet.
     */
    @JsonProperty(value = "availabilitySetName")
    private String availabilitySetName;

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

    /**
     * Get the virtualMachines property: The list of virtual machine naming details.
     *
     * @return the virtualMachines value.
     */
    public List<VirtualMachineResourceNames> virtualMachines() {
        return this.virtualMachines;
    }

    /**
     * Set the virtualMachines property: The list of virtual machine naming details.
     *
     * @param virtualMachines the virtualMachines value to set.
     * @return the ApplicationServerFullResourceNames object itself.
     */
    public ApplicationServerFullResourceNames withVirtualMachines(List<VirtualMachineResourceNames> virtualMachines) {
        this.virtualMachines = virtualMachines;
        return this;
    }

    /**
     * Get the availabilitySetName property: The full name for availability set. In case name is not provided, it will
     * be defaulted to {SID}-App-AvSet.
     *
     * @return the availabilitySetName value.
     */
    public String availabilitySetName() {
        return this.availabilitySetName;
    }

    /**
     * Set the availabilitySetName property: The full name for availability set. In case name is not provided, it will
     * be defaulted to {SID}-App-AvSet.
     *
     * @param availabilitySetName the availabilitySetName value to set.
     * @return the ApplicationServerFullResourceNames object itself.
     */
    public ApplicationServerFullResourceNames withAvailabilitySetName(String availabilitySetName) {
        this.availabilitySetName = availabilitySetName;
        return this;
    }

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