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

package com.azure.resourcemanager.elasticsan.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.elasticsan.models.ProvisioningStates;
import com.azure.resourcemanager.elasticsan.models.Sku;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Response for ElasticSan request. */
@Fluent
public final class ElasticSanInner extends Resource {
    /*
     * Properties of ElasticSan.
     */
    @JsonProperty(value = "properties", required = true)
    private ElasticSanProperties innerProperties = new ElasticSanProperties();

    /*
     * Resource metadata required by ARM RPC
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Properties of ElasticSan.
     *
     * @return the innerProperties value.
     */
    private ElasticSanProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Resource metadata required by ARM RPC.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

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

    /**
     * Get the sku property: resource sku.
     *
     * @return the sku value.
     */
    public Sku sku() {
        return this.innerProperties() == null ? null : this.innerProperties().sku();
    }

    /**
     * Set the sku property: resource sku.
     *
     * @param sku the sku value to set.
     * @return the ElasticSanInner object itself.
     */
    public ElasticSanInner withSku(Sku sku) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ElasticSanProperties();
        }
        this.innerProperties().withSku(sku);
        return this;
    }

    /**
     * Get the availabilityZones property: Logical zone for Elastic San resource; example: ["1"].
     *
     * @return the availabilityZones value.
     */
    public List<String> availabilityZones() {
        return this.innerProperties() == null ? null : this.innerProperties().availabilityZones();
    }

    /**
     * Set the availabilityZones property: Logical zone for Elastic San resource; example: ["1"].
     *
     * @param availabilityZones the availabilityZones value to set.
     * @return the ElasticSanInner object itself.
     */
    public ElasticSanInner withAvailabilityZones(List<String> availabilityZones) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ElasticSanProperties();
        }
        this.innerProperties().withAvailabilityZones(availabilityZones);
        return this;
    }

    /**
     * Get the provisioningState property: State of the operation on the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningStates provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
     *
     * @return the baseSizeTiB value.
     */
    public long baseSizeTiB() {
        return this.innerProperties() == null ? 0L : this.innerProperties().baseSizeTiB();
    }

    /**
     * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
     *
     * @param baseSizeTiB the baseSizeTiB value to set.
     * @return the ElasticSanInner object itself.
     */
    public ElasticSanInner withBaseSizeTiB(long baseSizeTiB) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ElasticSanProperties();
        }
        this.innerProperties().withBaseSizeTiB(baseSizeTiB);
        return this;
    }

    /**
     * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
     *
     * @return the extendedCapacitySizeTiB value.
     */
    public long extendedCapacitySizeTiB() {
        return this.innerProperties() == null ? 0L : this.innerProperties().extendedCapacitySizeTiB();
    }

    /**
     * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
     *
     * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set.
     * @return the ElasticSanInner object itself.
     */
    public ElasticSanInner withExtendedCapacitySizeTiB(long extendedCapacitySizeTiB) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ElasticSanProperties();
        }
        this.innerProperties().withExtendedCapacitySizeTiB(extendedCapacitySizeTiB);
        return this;
    }

    /**
     * Get the totalVolumeSizeGiB property: Total size of the provisioned Volumes in GiB.
     *
     * @return the totalVolumeSizeGiB value.
     */
    public Long totalVolumeSizeGiB() {
        return this.innerProperties() == null ? null : this.innerProperties().totalVolumeSizeGiB();
    }

    /**
     * Get the volumeGroupCount property: Total number of volume groups in this Elastic San appliance.
     *
     * @return the volumeGroupCount value.
     */
    public Long volumeGroupCount() {
        return this.innerProperties() == null ? null : this.innerProperties().volumeGroupCount();
    }

    /**
     * Get the totalIops property: Total Provisioned IOPS of the Elastic San appliance.
     *
     * @return the totalIops value.
     */
    public Long totalIops() {
        return this.innerProperties() == null ? null : this.innerProperties().totalIops();
    }

    /**
     * Get the totalMBps property: Total Provisioned MBps Elastic San appliance.
     *
     * @return the totalMBps value.
     */
    public Long totalMBps() {
        return this.innerProperties() == null ? null : this.innerProperties().totalMBps();
    }

    /**
     * Get the totalSizeTiB property: Total size of the Elastic San appliance in TB.
     *
     * @return the totalSizeTiB value.
     */
    public Long totalSizeTiB() {
        return this.innerProperties() == null ? null : this.innerProperties().totalSizeTiB();
    }

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

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