// 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;

/** Unmanaged file system mounting configuration. */
@Fluent
public final class UnmanagedFileSystemReference {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(UnmanagedFileSystemReference.class);

    /*
     * Mount command line. Note, Batch AI will append mount path to the command
     * on its own.
     */
    @JsonProperty(value = "mountCommand", required = true)
    private String mountCommand;

    /*
     * The relative path on the compute node where the unmanaged file system
     * will be mounted. Note that all cluster level unmanaged file systems will
     * be mounted under $AZ_BATCHAI_MOUNT_ROOT location and all job level
     * unmanaged file systems will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT.
     */
    @JsonProperty(value = "relativeMountPath", required = true)
    private String relativeMountPath;

    /**
     * Get the mountCommand property: Mount command line. Note, Batch AI will append mount path to the command on its
     * own.
     *
     * @return the mountCommand value.
     */
    public String mountCommand() {
        return this.mountCommand;
    }

    /**
     * Set the mountCommand property: Mount command line. Note, Batch AI will append mount path to the command on its
     * own.
     *
     * @param mountCommand the mountCommand value to set.
     * @return the UnmanagedFileSystemReference object itself.
     */
    public UnmanagedFileSystemReference withMountCommand(String mountCommand) {
        this.mountCommand = mountCommand;
        return this;
    }

    /**
     * Get the relativeMountPath property: The relative path on the compute node where the unmanaged file system will be
     * mounted. Note that all cluster level unmanaged file systems will be mounted under $AZ_BATCHAI_MOUNT_ROOT location
     * and all job level unmanaged file systems will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT.
     *
     * @return the relativeMountPath value.
     */
    public String relativeMountPath() {
        return this.relativeMountPath;
    }

    /**
     * Set the relativeMountPath property: The relative path on the compute node where the unmanaged file system will be
     * mounted. Note that all cluster level unmanaged file systems will be mounted under $AZ_BATCHAI_MOUNT_ROOT location
     * and all job level unmanaged file systems will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT.
     *
     * @param relativeMountPath the relativeMountPath value to set.
     * @return the UnmanagedFileSystemReference object itself.
     */
    public UnmanagedFileSystemReference withRelativeMountPath(String relativeMountPath) {
        this.relativeMountPath = relativeMountPath;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (mountCommand() == null) {
            throw logger
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property mountCommand in model UnmanagedFileSystemReference"));
        }
        if (relativeMountPath() == null) {
            throw logger
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property relativeMountPath in model UnmanagedFileSystemReference"));
        }
    }
}
