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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleProperties;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName;
import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The NetworkRackSku resource definition. */
@Fluent
public final class NetworkRackSkuInner extends ProxyResource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private NetworkRackSkuProperties innerProperties = new NetworkRackSkuProperties();

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

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

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private NetworkRackSkuProperties 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 roleName property: The role of the Network Rack: Aggregate or Compute.
     *
     * @return the roleName value.
     */
    public NetworkRackRoleName roleName() {
        return this.innerProperties() == null ? null : this.innerProperties().roleName();
    }

    /**
     * Set the roleName property: The role of the Network Rack: Aggregate or Compute.
     *
     * @param roleName the roleName value to set.
     * @return the NetworkRackSkuInner object itself.
     */
    public NetworkRackSkuInner withRoleName(NetworkRackRoleName roleName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkRackSkuProperties();
        }
        this.innerProperties().withRoleName(roleName);
        return this;
    }

    /**
     * Get the maximumServerCount property: Maximum number of servers available for this SKU.
     *
     * @return the maximumServerCount value.
     */
    public Integer maximumServerCount() {
        return this.innerProperties() == null ? null : this.innerProperties().maximumServerCount();
    }

    /**
     * Set the maximumServerCount property: Maximum number of servers available for this SKU.
     *
     * @param maximumServerCount the maximumServerCount value to set.
     * @return the NetworkRackSkuInner object itself.
     */
    public NetworkRackSkuInner withMaximumServerCount(Integer maximumServerCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkRackSkuProperties();
        }
        this.innerProperties().withMaximumServerCount(maximumServerCount);
        return this;
    }

    /**
     * Get the maximumStorageCount property: Maximum number of storage devices available for this SKU.
     *
     * @return the maximumStorageCount value.
     */
    public Integer maximumStorageCount() {
        return this.innerProperties() == null ? null : this.innerProperties().maximumStorageCount();
    }

    /**
     * Set the maximumStorageCount property: Maximum number of storage devices available for this SKU.
     *
     * @param maximumStorageCount the maximumStorageCount value to set.
     * @return the NetworkRackSkuInner object itself.
     */
    public NetworkRackSkuInner withMaximumStorageCount(Integer maximumStorageCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkRackSkuProperties();
        }
        this.innerProperties().withMaximumStorageCount(maximumStorageCount);
        return this;
    }

    /**
     * Get the maximumUplinks property: Maximum number of network uplinks available for this SKU.
     *
     * @return the maximumUplinks value.
     */
    public Integer maximumUplinks() {
        return this.innerProperties() == null ? null : this.innerProperties().maximumUplinks();
    }

    /**
     * Set the maximumUplinks property: Maximum number of network uplinks available for this SKU.
     *
     * @param maximumUplinks the maximumUplinks value to set.
     * @return the NetworkRackSkuInner object itself.
     */
    public NetworkRackSkuInner withMaximumUplinks(Integer maximumUplinks) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkRackSkuProperties();
        }
        this.innerProperties().withMaximumUplinks(maximumUplinks);
        return this;
    }

    /**
     * Get the networkDevices property: List of network device properties / role for the Network Rack.
     *
     * @return the networkDevices value.
     */
    public List<NetworkDeviceRoleProperties> networkDevices() {
        return this.innerProperties() == null ? null : this.innerProperties().networkDevices();
    }

    /**
     * Set the networkDevices property: List of network device properties / role for the Network Rack.
     *
     * @param networkDevices the networkDevices value to set.
     * @return the NetworkRackSkuInner object itself.
     */
    public NetworkRackSkuInner withNetworkDevices(List<NetworkDeviceRoleProperties> networkDevices) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkRackSkuProperties();
        }
        this.innerProperties().withNetworkDevices(networkDevices);
        return this;
    }

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

    /**
     * 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 NetworkRackSkuInner"));
        } else {
            innerProperties().validate();
        }
    }

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