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

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

/** AML file system HSM settings. */
@Fluent
public final class AmlFilesystemHsmSettings {
    /*
     * Resource ID of storage container used for hydrating the namespace and archiving from the namespace. The resource
     * provider must have permission to create SAS tokens on the storage account.
     */
    @JsonProperty(value = "container", required = true)
    private String container;

    /*
     * Resource ID of storage container used for logging events and errors.  Must be a separate container in the same
     * storage account as the hydration and archive container. The resource provider must have permission to create SAS
     * tokens on the storage account.
     */
    @JsonProperty(value = "loggingContainer", required = true)
    private String loggingContainer;

    /*
     * Only blobs in the non-logging container that start with this path/prefix get hydrated into the cluster
     * namespace.
     */
    @JsonProperty(value = "importPrefix")
    private String importPrefix;

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

    /**
     * Get the container property: Resource ID of storage container used for hydrating the namespace and archiving from
     * the namespace. The resource provider must have permission to create SAS tokens on the storage account.
     *
     * @return the container value.
     */
    public String container() {
        return this.container;
    }

    /**
     * Set the container property: Resource ID of storage container used for hydrating the namespace and archiving from
     * the namespace. The resource provider must have permission to create SAS tokens on the storage account.
     *
     * @param container the container value to set.
     * @return the AmlFilesystemHsmSettings object itself.
     */
    public AmlFilesystemHsmSettings withContainer(String container) {
        this.container = container;
        return this;
    }

    /**
     * Get the loggingContainer property: Resource ID of storage container used for logging events and errors. Must be a
     * separate container in the same storage account as the hydration and archive container. The resource provider must
     * have permission to create SAS tokens on the storage account.
     *
     * @return the loggingContainer value.
     */
    public String loggingContainer() {
        return this.loggingContainer;
    }

    /**
     * Set the loggingContainer property: Resource ID of storage container used for logging events and errors. Must be a
     * separate container in the same storage account as the hydration and archive container. The resource provider must
     * have permission to create SAS tokens on the storage account.
     *
     * @param loggingContainer the loggingContainer value to set.
     * @return the AmlFilesystemHsmSettings object itself.
     */
    public AmlFilesystemHsmSettings withLoggingContainer(String loggingContainer) {
        this.loggingContainer = loggingContainer;
        return this;
    }

    /**
     * Get the importPrefix property: Only blobs in the non-logging container that start with this path/prefix get
     * hydrated into the cluster namespace.
     *
     * @return the importPrefix value.
     */
    public String importPrefix() {
        return this.importPrefix;
    }

    /**
     * Set the importPrefix property: Only blobs in the non-logging container that start with this path/prefix get
     * hydrated into the cluster namespace.
     *
     * @param importPrefix the importPrefix value to set.
     * @return the AmlFilesystemHsmSettings object itself.
     */
    public AmlFilesystemHsmSettings withImportPrefix(String importPrefix) {
        this.importPrefix = importPrefix;
        return this;
    }

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

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