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

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.management.ProxyResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.batchai.models.DataDisks;
import com.azure.resourcemanager.batchai.models.FileServerProvisioningState;
import com.azure.resourcemanager.batchai.models.MountSettings;
import com.azure.resourcemanager.batchai.models.ResourceId;
import com.azure.resourcemanager.batchai.models.SshConfiguration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** File Server information. */
@JsonFlatten
@Fluent
public class FileServerInner extends ProxyResource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(FileServerInner.class);

    /*
     * VM size of the File Server.
     */
    @JsonProperty(value = "properties.vmSize")
    private String vmSize;

    /*
     * SSH configuration for accessing the File Server node.
     */
    @JsonProperty(value = "properties.sshConfiguration")
    private SshConfiguration sshConfiguration;

    /*
     * Information about disks attached to File Server VM.
     */
    @JsonProperty(value = "properties.dataDisks")
    private DataDisks dataDisks;

    /*
     * File Server virtual network subnet resource ID.
     */
    @JsonProperty(value = "properties.subnet")
    private ResourceId subnet;

    /*
     * File Server mount settings.
     */
    @JsonProperty(value = "properties.mountSettings", access = JsonProperty.Access.WRITE_ONLY)
    private MountSettings mountSettings;

    /*
     * Time when the provisioning state was changed.
     */
    @JsonProperty(value = "properties.provisioningStateTransitionTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime provisioningStateTransitionTime;

    /*
     * Time when the FileServer was created.
     */
    @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime creationTime;

    /*
     * Provisioning state of the File Server. Possible values: creating - The
     * File Server is getting created; updating - The File Server creation has
     * been accepted and it is getting updated; deleting - The user has
     * requested that the File Server be deleted, and it is in the process of
     * being deleted; failed - The File Server creation has failed with the
     * specified error code. Details about the error code are specified in the
     * message field; succeeded - The File Server creation has succeeded.
     */
    @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private FileServerProvisioningState provisioningState;

    /**
     * Get the vmSize property: VM size of the File Server.
     *
     * @return the vmSize value.
     */
    public String vmSize() {
        return this.vmSize;
    }

    /**
     * Set the vmSize property: VM size of the File Server.
     *
     * @param vmSize the vmSize value to set.
     * @return the FileServerInner object itself.
     */
    public FileServerInner withVmSize(String vmSize) {
        this.vmSize = vmSize;
        return this;
    }

    /**
     * Get the sshConfiguration property: SSH configuration for accessing the File Server node.
     *
     * @return the sshConfiguration value.
     */
    public SshConfiguration sshConfiguration() {
        return this.sshConfiguration;
    }

    /**
     * Set the sshConfiguration property: SSH configuration for accessing the File Server node.
     *
     * @param sshConfiguration the sshConfiguration value to set.
     * @return the FileServerInner object itself.
     */
    public FileServerInner withSshConfiguration(SshConfiguration sshConfiguration) {
        this.sshConfiguration = sshConfiguration;
        return this;
    }

    /**
     * Get the dataDisks property: Information about disks attached to File Server VM.
     *
     * @return the dataDisks value.
     */
    public DataDisks dataDisks() {
        return this.dataDisks;
    }

    /**
     * Set the dataDisks property: Information about disks attached to File Server VM.
     *
     * @param dataDisks the dataDisks value to set.
     * @return the FileServerInner object itself.
     */
    public FileServerInner withDataDisks(DataDisks dataDisks) {
        this.dataDisks = dataDisks;
        return this;
    }

    /**
     * Get the subnet property: File Server virtual network subnet resource ID.
     *
     * @return the subnet value.
     */
    public ResourceId subnet() {
        return this.subnet;
    }

    /**
     * Set the subnet property: File Server virtual network subnet resource ID.
     *
     * @param subnet the subnet value to set.
     * @return the FileServerInner object itself.
     */
    public FileServerInner withSubnet(ResourceId subnet) {
        this.subnet = subnet;
        return this;
    }

    /**
     * Get the mountSettings property: File Server mount settings.
     *
     * @return the mountSettings value.
     */
    public MountSettings mountSettings() {
        return this.mountSettings;
    }

    /**
     * Get the provisioningStateTransitionTime property: Time when the provisioning state was changed.
     *
     * @return the provisioningStateTransitionTime value.
     */
    public OffsetDateTime provisioningStateTransitionTime() {
        return this.provisioningStateTransitionTime;
    }

    /**
     * Get the creationTime property: Time when the FileServer was created.
     *
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.creationTime;
    }

    /**
     * Get the provisioningState property: Provisioning state of the File Server. Possible values: creating - The File
     * Server is getting created; updating - The File Server creation has been accepted and it is getting updated;
     * deleting - The user has requested that the File Server be deleted, and it is in the process of being deleted;
     * failed - The File Server creation has failed with the specified error code. Details about the error code are
     * specified in the message field; succeeded - The File Server creation has succeeded.
     *
     * @return the provisioningState value.
     */
    public FileServerProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (sshConfiguration() != null) {
            sshConfiguration().validate();
        }
        if (dataDisks() != null) {
            dataDisks().validate();
        }
        if (subnet() != null) {
            subnet().validate();
        }
        if (mountSettings() != null) {
            mountSettings().validate();
        }
    }
}
