// 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.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials;
import com.azure.resourcemanager.networkcloud.models.ExtendedLocation;
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;
import java.util.Map;

/** StorageAppliance represents on-premises Network Cloud storage appliance. */
@Fluent
public final class StorageApplianceInner extends Resource {
    /*
     * ExtendedLocation represents the Azure custom location where the resource will be created.
     *
     * The extended location of the cluster associated with the resource.
     */
    @JsonProperty(value = "extendedLocation", required = true)
    private ExtendedLocation extendedLocation;

    /*
     * StorageApplianceProperties represents the properties of the storage appliance.
     *
     * The list of the resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private StorageApplianceProperties innerProperties = new StorageApplianceProperties();

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

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

    /**
     * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will
     * be created.
     *
     * <p>The extended location of the cluster associated with the resource.
     *
     * @return the extendedLocation value.
     */
    public ExtendedLocation extendedLocation() {
        return this.extendedLocation;
    }

    /**
     * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will
     * be created.
     *
     * <p>The extended location of the cluster associated with the resource.
     *
     * @param extendedLocation the extendedLocation value to set.
     * @return the StorageApplianceInner object itself.
     */
    public StorageApplianceInner withExtendedLocation(ExtendedLocation extendedLocation) {
        this.extendedLocation = extendedLocation;
        return this;
    }

    /**
     * Get the innerProperties property: StorageApplianceProperties represents the properties of the storage appliance.
     *
     * <p>The list of the resource properties.
     *
     * @return the innerProperties value.
     */
    private StorageApplianceProperties 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;
    }

    /** {@inheritDoc} */
    @Override
    public StorageApplianceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public StorageApplianceInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * 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.innerProperties() == null ? null : this.innerProperties().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 StorageApplianceInner object itself.
     */
    public StorageApplianceInner withAdministratorCredentials(AdministrativeCredentials administratorCredentials) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StorageApplianceProperties();
        }
        this.innerProperties().withAdministratorCredentials(administratorCredentials);
        return this;
    }

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

    /**
     * Get the capacityUsed property: The amount of storage consumed.
     *
     * @return the capacityUsed value.
     */
    public Long capacityUsed() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().clusterId();
    }

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

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

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

    /**
     * Get the provisioningState property: The provisioning state of the storage appliance.
     *
     * @return the provisioningState value.
     */
    public StorageApplianceProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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 StorageApplianceInner object itself.
     */
    public StorageApplianceInner withRackId(String rackId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StorageApplianceProperties();
        }
        this.innerProperties().withRackId(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.innerProperties() == null ? 0L : this.innerProperties().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 StorageApplianceInner object itself.
     */
    public StorageApplianceInner withRackSlot(long rackSlot) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StorageApplianceProperties();
        }
        this.innerProperties().withRackSlot(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().remoteVendorManagementStatus();
    }

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

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

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

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

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

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