// 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.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
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;

/** RackSku represents the SKU information of the rack. */
@Immutable
public final class RackSkuInner extends ProxyResource {
    /*
     * RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both
     * aggregator and compute racks.
     *
     * The list of the resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private RackSkuProperties innerProperties = new RackSkuProperties();

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: RackSkuProperties represents the properties of compute-related hardware for a
     * rack. This supports both aggregator and compute racks.
     *
     * <p>The list of the resource properties.
     *
     * @return the innerProperties value.
     */
    private RackSkuProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * 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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().controllerMachines();
    }

    /**
     * Get the description property: The free-form text describing the rack.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().maxClusterSlots();
    }

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

    /**
     * Get the rackType property: The type of the rack.
     *
     * @return the rackType value.
     */
    public RackSkuType rackType() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().supportedRackSkuIds();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property innerProperties in model RackSkuInner"));
        } else {
            innerProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(RackSkuInner.class);
}
