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

package com.azure.resourcemanager.networkcloud.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.resourcemanager.networkcloud.models.MachineSkuSlot;
import com.azure.resourcemanager.networkcloud.models.RackSkuProvisioningState;
import com.azure.resourcemanager.networkcloud.models.RackSkuType;
import com.azure.resourcemanager.networkcloud.models.StorageApplianceSkuSlot;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
 * RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and
 * compute racks.
 */
@Immutable
public final class RackSkuProperties {
    /*
     * The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model.
     */
    @JsonProperty(value = "computeMachines", access = JsonProperty.Access.WRITE_ONLY)
    private List<MachineSkuSlot> computeMachines;

    /*
     * The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model.
     */
    @JsonProperty(value = "controllerMachines", access = JsonProperty.Access.WRITE_ONLY)
    private List<MachineSkuSlot> controllerMachines;

    /*
     * The free-form text describing the rack.
     */
    @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
    private String description;

    /*
     * The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a
     * single rack cluster(rackType="Single").
     */
    @JsonProperty(value = "maxClusterSlots", access = JsonProperty.Access.WRITE_ONLY)
    private Long maxClusterSlots;

    /*
     * The provisioning state of the rack SKU resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private RackSkuProvisioningState provisioningState;

    /*
     * The type of the rack.
     */
    @JsonProperty(value = "rackType", access = JsonProperty.Access.WRITE_ONLY)
    private RackSkuType rackType;

    /*
     * The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model.
     */
    @JsonProperty(value = "storageAppliances", access = JsonProperty.Access.WRITE_ONLY)
    private List<StorageApplianceSkuSlot> storageAppliances;

    /*
     * The list of supported SKUs if the rack is an aggregator.
     */
    @JsonProperty(value = "supportedRackSkuIds", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> supportedRackSkuIds;

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

    /**
     * Get the computeMachines property: The list of machine SKUs and associated rack slot for the compute-dedicated
     * machines in this rack model.
     *
     * @return the computeMachines value.
     */
    public List<MachineSkuSlot> computeMachines() {
        return this.computeMachines;
    }

    /**
     * Get the controllerMachines property: The list of machine SKUs and associated rack slot for the control-plane
     * dedicated machines in this rack model.
     *
     * @return the controllerMachines value.
     */
    public List<MachineSkuSlot> controllerMachines() {
        return this.controllerMachines;
    }

    /**
     * Get the description property: The free-form text describing the rack.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Get the maxClusterSlots property: The maximum number of compute racks supported by an aggregator rack. 0 if this
     * is a compute rack or a rack for a single rack cluster(rackType="Single").
     *
     * @return the maxClusterSlots value.
     */
    public Long maxClusterSlots() {
        return this.maxClusterSlots;
    }

    /**
     * Get the provisioningState property: The provisioning state of the rack SKU resource.
     *
     * @return the provisioningState value.
     */
    public RackSkuProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the rackType property: The type of the rack.
     *
     * @return the rackType value.
     */
    public RackSkuType rackType() {
        return this.rackType;
    }

    /**
     * Get the storageAppliances property: The list of appliance SKUs and associated rack slot for the storage
     * appliance(s) in this rack model.
     *
     * @return the storageAppliances value.
     */
    public List<StorageApplianceSkuSlot> storageAppliances() {
        return this.storageAppliances;
    }

    /**
     * Get the supportedRackSkuIds property: The list of supported SKUs if the rack is an aggregator.
     *
     * @return the supportedRackSkuIds value.
     */
    public List<String> supportedRackSkuIds() {
        return this.supportedRackSkuIds;
    }

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