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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemClientInfo;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemEncryptionSettings;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemHealth;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemIdentity;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemPropertiesHsm;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemPropertiesMaintenanceWindow;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemProvisioningStateType;
import com.azure.resourcemanager.storagecache.models.SkuName;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/**
 * An AML file system instance. Follows Azure Resource Manager standards:
 * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md.
 */
@Fluent
public final class AmlFilesystemInner extends Resource {
    /*
     * The managed identity used by the AML file system, if configured.
     */
    @JsonProperty(value = "identity")
    private AmlFilesystemIdentity identity;

    /*
     * SKU for the resource.
     */
    @JsonProperty(value = "sku")
    private SkuName sku;

    /*
     * Availability zones for resources. This field should only contain a single element in the array.
     */
    @JsonProperty(value = "zones")
    private List<String> zones;

    /*
     * Properties of the AML file system.
     */
    @JsonProperty(value = "properties")
    private AmlFilesystemProperties innerProperties;

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

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

    /**
     * Get the identity property: The managed identity used by the AML file system, if configured.
     *
     * @return the identity value.
     */
    public AmlFilesystemIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The managed identity used by the AML file system, if configured.
     *
     * @param identity the identity value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withIdentity(AmlFilesystemIdentity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the sku property: SKU for the resource.
     *
     * @return the sku value.
     */
    public SkuName sku() {
        return this.sku;
    }

    /**
     * Set the sku property: SKU for the resource.
     *
     * @param sku the sku value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withSku(SkuName sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the zones property: Availability zones for resources. This field should only contain a single element in the
     * array.
     *
     * @return the zones value.
     */
    public List<String> zones() {
        return this.zones;
    }

    /**
     * Set the zones property: Availability zones for resources. This field should only contain a single element in the
     * array.
     *
     * @param zones the zones value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withZones(List<String> zones) {
        this.zones = zones;
        return this;
    }

    /**
     * Get the innerProperties property: Properties of the AML file system.
     *
     * @return the innerProperties value.
     */
    private AmlFilesystemProperties 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 AmlFilesystemInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

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

    /**
     * Get the storageCapacityTiB property: The size of the AML file system, in TiB. This might be rounded up.
     *
     * @return the storageCapacityTiB value.
     */
    public Float storageCapacityTiB() {
        return this.innerProperties() == null ? null : this.innerProperties().storageCapacityTiB();
    }

    /**
     * Set the storageCapacityTiB property: The size of the AML file system, in TiB. This might be rounded up.
     *
     * @param storageCapacityTiB the storageCapacityTiB value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withStorageCapacityTiB(Float storageCapacityTiB) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AmlFilesystemProperties();
        }
        this.innerProperties().withStorageCapacityTiB(storageCapacityTiB);
        return this;
    }

    /**
     * Get the health property: Health of the AML file system.
     *
     * @return the health value.
     */
    public AmlFilesystemHealth health() {
        return this.innerProperties() == null ? null : this.innerProperties().health();
    }

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

    /**
     * Get the filesystemSubnet property: Subnet used for managing the AML file system and for client-facing operations.
     * This subnet should have at least a /24 subnet mask within the VNET's address space.
     *
     * @return the filesystemSubnet value.
     */
    public String filesystemSubnet() {
        return this.innerProperties() == null ? null : this.innerProperties().filesystemSubnet();
    }

    /**
     * Set the filesystemSubnet property: Subnet used for managing the AML file system and for client-facing operations.
     * This subnet should have at least a /24 subnet mask within the VNET's address space.
     *
     * @param filesystemSubnet the filesystemSubnet value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withFilesystemSubnet(String filesystemSubnet) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AmlFilesystemProperties();
        }
        this.innerProperties().withFilesystemSubnet(filesystemSubnet);
        return this;
    }

    /**
     * Get the clientInfo property: Client information for the AML file system.
     *
     * @return the clientInfo value.
     */
    public AmlFilesystemClientInfo clientInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().clientInfo();
    }

    /**
     * Get the throughputProvisionedMBps property: Throughput provisioned in MB per sec, calculated as
     * storageCapacityTiB * per-unit storage throughput.
     *
     * @return the throughputProvisionedMBps value.
     */
    public Integer throughputProvisionedMBps() {
        return this.innerProperties() == null ? null : this.innerProperties().throughputProvisionedMBps();
    }

    /**
     * Get the encryptionSettings property: Specifies encryption settings of the AML file system.
     *
     * @return the encryptionSettings value.
     */
    public AmlFilesystemEncryptionSettings encryptionSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().encryptionSettings();
    }

    /**
     * Set the encryptionSettings property: Specifies encryption settings of the AML file system.
     *
     * @param encryptionSettings the encryptionSettings value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withEncryptionSettings(AmlFilesystemEncryptionSettings encryptionSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AmlFilesystemProperties();
        }
        this.innerProperties().withEncryptionSettings(encryptionSettings);
        return this;
    }

    /**
     * Get the maintenanceWindow property: Start time of a 30-minute weekly maintenance window.
     *
     * @return the maintenanceWindow value.
     */
    public AmlFilesystemPropertiesMaintenanceWindow maintenanceWindow() {
        return this.innerProperties() == null ? null : this.innerProperties().maintenanceWindow();
    }

    /**
     * Set the maintenanceWindow property: Start time of a 30-minute weekly maintenance window.
     *
     * @param maintenanceWindow the maintenanceWindow value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withMaintenanceWindow(AmlFilesystemPropertiesMaintenanceWindow maintenanceWindow) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AmlFilesystemProperties();
        }
        this.innerProperties().withMaintenanceWindow(maintenanceWindow);
        return this;
    }

    /**
     * Get the hsm property: Hydration and archive settings and status.
     *
     * @return the hsm value.
     */
    public AmlFilesystemPropertiesHsm hsm() {
        return this.innerProperties() == null ? null : this.innerProperties().hsm();
    }

    /**
     * Set the hsm property: Hydration and archive settings and status.
     *
     * @param hsm the hsm value to set.
     * @return the AmlFilesystemInner object itself.
     */
    public AmlFilesystemInner withHsm(AmlFilesystemPropertiesHsm hsm) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AmlFilesystemProperties();
        }
        this.innerProperties().withHsm(hsm);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (identity() != null) {
            identity().validate();
        }
        if (sku() != null) {
            sku().validate();
        }
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
