// 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.util.logging.ClientLogger;
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.AmlFilesystemPropertiesHsm;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemPropertiesMaintenanceWindow;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemProvisioningStateType;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of the AML file system. */
@Fluent
public final class AmlFilesystemProperties {
    /*
     * The size of the AML file system, in TiB. This might be rounded up.
     */
    @JsonProperty(value = "storageCapacityTiB", required = true)
    private float storageCapacityTiB;

    /*
     * Health of the AML file system.
     */
    @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY)
    private AmlFilesystemHealth health;

    /*
     * ARM provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private AmlFilesystemProvisioningStateType provisioningState;

    /*
     * 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.
     */
    @JsonProperty(value = "filesystemSubnet", required = true)
    private String filesystemSubnet;

    /*
     * Client information for the AML file system.
     */
    @JsonProperty(value = "clientInfo", access = JsonProperty.Access.WRITE_ONLY)
    private AmlFilesystemClientInfo clientInfo;

    /*
     * Throughput provisioned in MB per sec, calculated as storageCapacityTiB * per-unit storage throughput
     */
    @JsonProperty(value = "throughputProvisionedMBps", access = JsonProperty.Access.WRITE_ONLY)
    private Integer throughputProvisionedMBps;

    /*
     * Specifies encryption settings of the AML file system.
     */
    @JsonProperty(value = "encryptionSettings")
    private AmlFilesystemEncryptionSettings encryptionSettings;

    /*
     * Start time of a 30-minute weekly maintenance window.
     */
    @JsonProperty(value = "maintenanceWindow", required = true)
    private AmlFilesystemPropertiesMaintenanceWindow maintenanceWindow;

    /*
     * Hydration and archive settings and status
     */
    @JsonProperty(value = "hsm")
    private AmlFilesystemPropertiesHsm hsm;

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

    /**
     * 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.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 AmlFilesystemProperties object itself.
     */
    public AmlFilesystemProperties withStorageCapacityTiB(float storageCapacityTiB) {
        this.storageCapacityTiB = storageCapacityTiB;
        return this;
    }

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

    /**
     * Get the provisioningState property: ARM provisioning state.
     *
     * @return the provisioningState value.
     */
    public AmlFilesystemProvisioningStateType provisioningState() {
        return this.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.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 AmlFilesystemProperties object itself.
     */
    public AmlFilesystemProperties withFilesystemSubnet(String filesystemSubnet) {
        this.filesystemSubnet = filesystemSubnet;
        return this;
    }

    /**
     * Get the clientInfo property: Client information for the AML file system.
     *
     * @return the clientInfo value.
     */
    public AmlFilesystemClientInfo clientInfo() {
        return this.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.throughputProvisionedMBps;
    }

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

    /**
     * Set the encryptionSettings property: Specifies encryption settings of the AML file system.
     *
     * @param encryptionSettings the encryptionSettings value to set.
     * @return the AmlFilesystemProperties object itself.
     */
    public AmlFilesystemProperties withEncryptionSettings(AmlFilesystemEncryptionSettings encryptionSettings) {
        this.encryptionSettings = 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.maintenanceWindow;
    }

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

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

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

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (health() != null) {
            health().validate();
        }
        if (filesystemSubnet() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property filesystemSubnet in model AmlFilesystemProperties"));
        }
        if (clientInfo() != null) {
            clientInfo().validate();
        }
        if (encryptionSettings() != null) {
            encryptionSettings().validate();
        }
        if (maintenanceWindow() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property maintenanceWindow in model AmlFilesystemProperties"));
        } else {
            maintenanceWindow().validate();
        }
        if (hsm() != null) {
            hsm().validate();
        }
    }

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