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

package com.azure.resourcemanager.datamigration.models;

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

/** File share information with Path, Username, and Password. */
@Fluent
public final class FileShare {
    /*
     * User name credential to connect to the share location
     */
    @JsonProperty(value = "userName")
    private String username;

    /*
     * Password credential used to connect to the share location.
     */
    @JsonProperty(value = "password")
    private String password;

    /*
     * The folder path for this share.
     */
    @JsonProperty(value = "path", required = true)
    private String path;

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

    /**
     * Get the username property: User name credential to connect to the share location.
     *
     * @return the username value.
     */
    public String username() {
        return this.username;
    }

    /**
     * Set the username property: User name credential to connect to the share location.
     *
     * @param username the username value to set.
     * @return the FileShare object itself.
     */
    public FileShare withUsername(String username) {
        this.username = username;
        return this;
    }

    /**
     * Get the password property: Password credential used to connect to the share location.
     *
     * @return the password value.
     */
    public String password() {
        return this.password;
    }

    /**
     * Set the password property: Password credential used to connect to the share location.
     *
     * @param password the password value to set.
     * @return the FileShare object itself.
     */
    public FileShare withPassword(String password) {
        this.password = password;
        return this;
    }

    /**
     * Get the path property: The folder path for this share.
     *
     * @return the path value.
     */
    public String path() {
        return this.path;
    }

    /**
     * Set the path property: The folder path for this share.
     *
     * @param path the path value to set.
     * @return the FileShare object itself.
     */
    public FileShare withPath(String path) {
        this.path = path;
        return this;
    }

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

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