// 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 central server layer resources. */
@Fluent
public final class CentralServerFullResourceNames {
    /*
     * The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be
     * equal to the number VMs to be created for ASCS layer. At maximum, there can be two virtual machines at this
     * layer: ASCS and ERS.
     */
    @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}-ASCS-AvSet.
     */
    @JsonProperty(value = "availabilitySetName")
    private String availabilitySetName;

    /*
     * The resource names object for load balancer and related resources.
     */
    @JsonProperty(value = "loadBalancer")
    private LoadBalancerResourceNames loadBalancer;

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

    /**
     * Get the virtualMachines property: The list of names for all ASCS virtual machines to be deployed. The number of
     * entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two
     * virtual machines at this layer: ASCS and ERS.
     *
     * @return the virtualMachines value.
     */
    public List<VirtualMachineResourceNames> virtualMachines() {
        return this.virtualMachines;
    }

    /**
     * Set the virtualMachines property: The list of names for all ASCS virtual machines to be deployed. The number of
     * entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two
     * virtual machines at this layer: ASCS and ERS.
     *
     * @param virtualMachines the virtualMachines value to set.
     * @return the CentralServerFullResourceNames object itself.
     */
    public CentralServerFullResourceNames 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}-ASCS-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}-ASCS-AvSet.
     *
     * @param availabilitySetName the availabilitySetName value to set.
     * @return the CentralServerFullResourceNames object itself.
     */
    public CentralServerFullResourceNames withAvailabilitySetName(String availabilitySetName) {
        this.availabilitySetName = availabilitySetName;
        return this;
    }

    /**
     * Get the loadBalancer property: The resource names object for load balancer and related resources.
     *
     * @return the loadBalancer value.
     */
    public LoadBalancerResourceNames loadBalancer() {
        return this.loadBalancer;
    }

    /**
     * Set the loadBalancer property: The resource names object for load balancer and related resources.
     *
     * @param loadBalancer the loadBalancer value to set.
     * @return the CentralServerFullResourceNames object itself.
     */
    public CentralServerFullResourceNames withLoadBalancer(LoadBalancerResourceNames loadBalancer) {
        this.loadBalancer = loadBalancer;
        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());
        }
        if (loadBalancer() != null) {
            loadBalancer().validate();
        }
    }
}
