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

package com.azure.resourcemanager.batchai.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Details of volumes to mount on the cluster. */
@Fluent
public final class MountVolumes {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(MountVolumes.class);

    /*
     * A collection of Azure File Shares that are to be mounted to the cluster
     * nodes.
     */
    @JsonProperty(value = "azureFileShares")
    private List<AzureFileShareReference> azureFileShares;

    /*
     * A collection of Azure Blob Containers that are to be mounted to the
     * cluster nodes.
     */
    @JsonProperty(value = "azureBlobFileSystems")
    private List<AzureBlobFileSystemReference> azureBlobFileSystems;

    /*
     * A collection of Batch AI File Servers that are to be mounted to the
     * cluster nodes.
     */
    @JsonProperty(value = "fileServers")
    private List<FileServerReference> fileServers;

    /*
     * A collection of unmanaged file systems that are to be mounted to the
     * cluster nodes.
     */
    @JsonProperty(value = "unmanagedFileSystems")
    private List<UnmanagedFileSystemReference> unmanagedFileSystems;

    /**
     * Get the azureFileShares property: A collection of Azure File Shares that are to be mounted to the cluster nodes.
     *
     * @return the azureFileShares value.
     */
    public List<AzureFileShareReference> azureFileShares() {
        return this.azureFileShares;
    }

    /**
     * Set the azureFileShares property: A collection of Azure File Shares that are to be mounted to the cluster nodes.
     *
     * @param azureFileShares the azureFileShares value to set.
     * @return the MountVolumes object itself.
     */
    public MountVolumes withAzureFileShares(List<AzureFileShareReference> azureFileShares) {
        this.azureFileShares = azureFileShares;
        return this;
    }

    /**
     * Get the azureBlobFileSystems property: A collection of Azure Blob Containers that are to be mounted to the
     * cluster nodes.
     *
     * @return the azureBlobFileSystems value.
     */
    public List<AzureBlobFileSystemReference> azureBlobFileSystems() {
        return this.azureBlobFileSystems;
    }

    /**
     * Set the azureBlobFileSystems property: A collection of Azure Blob Containers that are to be mounted to the
     * cluster nodes.
     *
     * @param azureBlobFileSystems the azureBlobFileSystems value to set.
     * @return the MountVolumes object itself.
     */
    public MountVolumes withAzureBlobFileSystems(List<AzureBlobFileSystemReference> azureBlobFileSystems) {
        this.azureBlobFileSystems = azureBlobFileSystems;
        return this;
    }

    /**
     * Get the fileServers property: A collection of Batch AI File Servers that are to be mounted to the cluster nodes.
     *
     * @return the fileServers value.
     */
    public List<FileServerReference> fileServers() {
        return this.fileServers;
    }

    /**
     * Set the fileServers property: A collection of Batch AI File Servers that are to be mounted to the cluster nodes.
     *
     * @param fileServers the fileServers value to set.
     * @return the MountVolumes object itself.
     */
    public MountVolumes withFileServers(List<FileServerReference> fileServers) {
        this.fileServers = fileServers;
        return this;
    }

    /**
     * Get the unmanagedFileSystems property: A collection of unmanaged file systems that are to be mounted to the
     * cluster nodes.
     *
     * @return the unmanagedFileSystems value.
     */
    public List<UnmanagedFileSystemReference> unmanagedFileSystems() {
        return this.unmanagedFileSystems;
    }

    /**
     * Set the unmanagedFileSystems property: A collection of unmanaged file systems that are to be mounted to the
     * cluster nodes.
     *
     * @param unmanagedFileSystems the unmanagedFileSystems value to set.
     * @return the MountVolumes object itself.
     */
    public MountVolumes withUnmanagedFileSystems(List<UnmanagedFileSystemReference> unmanagedFileSystems) {
        this.unmanagedFileSystems = unmanagedFileSystems;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (azureFileShares() != null) {
            azureFileShares().forEach(e -> e.validate());
        }
        if (azureBlobFileSystems() != null) {
            azureBlobFileSystems().forEach(e -> e.validate());
        }
        if (fileServers() != null) {
            fileServers().forEach(e -> e.validate());
        }
        if (unmanagedFileSystems() != null) {
            unmanagedFileSystems().forEach(e -> e.validate());
        }
    }
}
