// 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.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials;
import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementFeature;
import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementStatus;
import com.azure.resourcemanager.networkcloud.models.StorageApplianceDetailedStatus;
import com.azure.resourcemanager.networkcloud.models.StorageApplianceProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

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

    /*
     * The total capacity of the storage appliance.
     */
    @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY)
    private Long capacity;

    /*
     * The amount of storage consumed.
     */
    @JsonProperty(value = "capacityUsed", access = JsonProperty.Access.WRITE_ONLY)
    private Long capacityUsed;

    /*
     * The resource ID of the cluster this storage appliance is associated with.
     */
    @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY)
    private String clusterId;

    /*
     * The detailed status of the storage appliance.
     */
    @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY)
    private StorageApplianceDetailedStatus detailedStatus;

    /*
     * The descriptive message about the current detailed status.
     */
    @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY)
    private String detailedStatusMessage;

    /*
     * The endpoint for the management interface of the storage appliance.
     */
    @JsonProperty(value = "managementIpv4Address", access = JsonProperty.Access.WRITE_ONLY)
    private String managementIpv4Address;

    /*
     * The provisioning state of the storage appliance.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private StorageApplianceProvisioningState provisioningState;

    /*
     * The resource ID of the rack where this storage appliance resides.
     */
    @JsonProperty(value = "rackId", required = true)
    private String rackId;

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

    /*
     * The indicator of whether the storage appliance supports remote vendor management.
     */
    @JsonProperty(value = "remoteVendorManagementFeature", access = JsonProperty.Access.WRITE_ONLY)
    private RemoteVendorManagementFeature remoteVendorManagementFeature;

    /*
     * The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an
     * unsupported feature.
     */
    @JsonProperty(value = "remoteVendorManagementStatus", access = JsonProperty.Access.WRITE_ONLY)
    private RemoteVendorManagementStatus remoteVendorManagementStatus;

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

    /*
     * The SKU for the storage appliance.
     */
    @JsonProperty(value = "storageApplianceSkuId", required = true)
    private String storageApplianceSkuId;

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

    /**
     * Get the administratorCredentials 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 administratorCredentials value.
     */
    public AdministrativeCredentials administratorCredentials() {
        return this.administratorCredentials;
    }

    /**
     * Set the administratorCredentials 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 administratorCredentials the administratorCredentials value to set.
     * @return the StorageApplianceProperties object itself.
     */
    public StorageApplianceProperties withAdministratorCredentials(AdministrativeCredentials administratorCredentials) {
        this.administratorCredentials = administratorCredentials;
        return this;
    }

    /**
     * Get the capacity property: The total capacity of the storage appliance.
     *
     * @return the capacity value.
     */
    public Long capacity() {
        return this.capacity;
    }

    /**
     * Get the capacityUsed property: The amount of storage consumed.
     *
     * @return the capacityUsed value.
     */
    public Long capacityUsed() {
        return this.capacityUsed;
    }

    /**
     * Get the clusterId property: The resource ID of the cluster this storage appliance is associated with.
     *
     * @return the clusterId value.
     */
    public String clusterId() {
        return this.clusterId;
    }

    /**
     * Get the detailedStatus property: The detailed status of the storage appliance.
     *
     * @return the detailedStatus value.
     */
    public StorageApplianceDetailedStatus detailedStatus() {
        return this.detailedStatus;
    }

    /**
     * Get the detailedStatusMessage property: The descriptive message about the current detailed status.
     *
     * @return the detailedStatusMessage value.
     */
    public String detailedStatusMessage() {
        return this.detailedStatusMessage;
    }

    /**
     * Get the managementIpv4Address property: The endpoint for the management interface of the storage appliance.
     *
     * @return the managementIpv4Address value.
     */
    public String managementIpv4Address() {
        return this.managementIpv4Address;
    }

    /**
     * Get the provisioningState property: The provisioning state of the storage appliance.
     *
     * @return the provisioningState value.
     */
    public StorageApplianceProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the rackId property: The resource ID of the rack where this storage appliance resides.
     *
     * @return the rackId value.
     */
    public String rackId() {
        return this.rackId;
    }

    /**
     * Set the rackId property: The resource ID of the rack where this storage appliance resides.
     *
     * @param rackId the rackId value to set.
     * @return the StorageApplianceProperties object itself.
     */
    public StorageApplianceProperties withRackId(String rackId) {
        this.rackId = rackId;
        return this;
    }

    /**
     * Get the rackSlot property: The slot the 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 the storage appliance is in the rack based on the BOM configuration.
     *
     * @param rackSlot the rackSlot value to set.
     * @return the StorageApplianceProperties object itself.
     */
    public StorageApplianceProperties withRackSlot(long rackSlot) {
        this.rackSlot = rackSlot;
        return this;
    }

    /**
     * Get the remoteVendorManagementFeature property: The indicator of whether the storage appliance supports remote
     * vendor management.
     *
     * @return the remoteVendorManagementFeature value.
     */
    public RemoteVendorManagementFeature remoteVendorManagementFeature() {
        return this.remoteVendorManagementFeature;
    }

    /**
     * Get the remoteVendorManagementStatus property: The indicator of whether the remote vendor management feature is
     * enabled or disabled, or unsupported if it is an unsupported feature.
     *
     * @return the remoteVendorManagementStatus value.
     */
    public RemoteVendorManagementStatus remoteVendorManagementStatus() {
        return this.remoteVendorManagementStatus;
    }

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

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

    /**
     * Get the storageApplianceSkuId property: The SKU for the storage appliance.
     *
     * @return the storageApplianceSkuId value.
     */
    public String storageApplianceSkuId() {
        return this.storageApplianceSkuId;
    }

    /**
     * Set the storageApplianceSkuId property: The SKU for the storage appliance.
     *
     * @param storageApplianceSkuId the storageApplianceSkuId value to set.
     * @return the StorageApplianceProperties object itself.
     */
    public StorageApplianceProperties withStorageApplianceSkuId(String storageApplianceSkuId) {
        this.storageApplianceSkuId = storageApplianceSkuId;
        return this;
    }

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

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