// 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** StorageApplianceConfigurationData represents configuration for the storage application. */
@Fluent
public final class StorageApplianceConfigurationData {
    /*
     * AdministrativeCredentials represents the admin credentials for the device requiring password-based
     * authentication.
     *
     * The credentials of the administrative interface on this storage appliance.
     */
    @JsonProperty(value = "adminCredentials", required = true)
    private AdministrativeCredentials adminCredentials;

    /*
     * The slot that storage appliance is in the rack based on the BOM configuration.
     */
    @JsonProperty(value = "rackSlot", required = true)
    private long rackSlot;

    /*
     * The serial number of the appliance.
     */
    @JsonProperty(value = "serialNumber", required = true)
    private String serialNumber;

    /*
     * The user-provided name for the storage appliance that will be created from this specification.
     */
    @JsonProperty(value = "storageApplianceName")
    private String storageApplianceName;

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

    /**
     * Get the adminCredentials property: AdministrativeCredentials represents the admin credentials for the device
     * requiring password-based authentication.
     *
     * <p>The credentials of the administrative interface on this storage appliance.
     *
     * @return the adminCredentials value.
     */
    public AdministrativeCredentials adminCredentials() {
        return this.adminCredentials;
    }

    /**
     * Set the adminCredentials property: AdministrativeCredentials represents the admin credentials for the device
     * requiring password-based authentication.
     *
     * <p>The credentials of the administrative interface on this storage appliance.
     *
     * @param adminCredentials the adminCredentials value to set.
     * @return the StorageApplianceConfigurationData object itself.
     */
    public StorageApplianceConfigurationData withAdminCredentials(AdministrativeCredentials adminCredentials) {
        this.adminCredentials = adminCredentials;
        return this;
    }

    /**
     * Get the rackSlot property: The slot that storage appliance is in the rack based on the BOM configuration.
     *
     * @return the rackSlot value.
     */
    public long rackSlot() {
        return this.rackSlot;
    }

    /**
     * Set the rackSlot property: The slot that storage appliance is in the rack based on the BOM configuration.
     *
     * @param rackSlot the rackSlot value to set.
     * @return the StorageApplianceConfigurationData object itself.
     */
    public StorageApplianceConfigurationData withRackSlot(long rackSlot) {
        this.rackSlot = rackSlot;
        return this;
    }

    /**
     * Get the serialNumber property: The serial number of the appliance.
     *
     * @return the serialNumber value.
     */
    public String serialNumber() {
        return this.serialNumber;
    }

    /**
     * Set the serialNumber property: The serial number of the appliance.
     *
     * @param serialNumber the serialNumber value to set.
     * @return the StorageApplianceConfigurationData object itself.
     */
    public StorageApplianceConfigurationData withSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
        return this;
    }

    /**
     * Get the storageApplianceName property: The user-provided name for the storage appliance that will be created from
     * this specification.
     *
     * @return the storageApplianceName value.
     */
    public String storageApplianceName() {
        return this.storageApplianceName;
    }

    /**
     * Set the storageApplianceName property: The user-provided name for the storage appliance that will be created from
     * this specification.
     *
     * @param storageApplianceName the storageApplianceName value to set.
     * @return the StorageApplianceConfigurationData object itself.
     */
    public StorageApplianceConfigurationData withStorageApplianceName(String storageApplianceName) {
        this.storageApplianceName = storageApplianceName;
        return this;
    }

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

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