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

package com.azure.resourcemanager.machinelearningservices.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;

/** The VirtualMachineProperties model. */
@Fluent
public final class VirtualMachineProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineProperties.class);

    /*
     * Virtual Machine size
     */
    @JsonProperty(value = "virtualMachineSize")
    private String virtualMachineSize;

    /*
     * Port open for ssh connections.
     */
    @JsonProperty(value = "sshPort")
    private Integer sshPort;

    /*
     * Public IP address of the virtual machine.
     */
    @JsonProperty(value = "address")
    private String address;

    /*
     * Admin credentials for virtual machine
     */
    @JsonProperty(value = "administratorAccount")
    private VirtualMachineSshCredentials administratorAccount;

    /*
     * Indicates whether this compute will be used for running notebooks.
     */
    @JsonProperty(value = "isNotebookInstanceCompute")
    private Boolean isNotebookInstanceCompute;

    /**
     * Get the virtualMachineSize property: Virtual Machine size.
     *
     * @return the virtualMachineSize value.
     */
    public String virtualMachineSize() {
        return this.virtualMachineSize;
    }

    /**
     * Set the virtualMachineSize property: Virtual Machine size.
     *
     * @param virtualMachineSize the virtualMachineSize value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withVirtualMachineSize(String virtualMachineSize) {
        this.virtualMachineSize = virtualMachineSize;
        return this;
    }

    /**
     * Get the sshPort property: Port open for ssh connections.
     *
     * @return the sshPort value.
     */
    public Integer sshPort() {
        return this.sshPort;
    }

    /**
     * Set the sshPort property: Port open for ssh connections.
     *
     * @param sshPort the sshPort value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withSshPort(Integer sshPort) {
        this.sshPort = sshPort;
        return this;
    }

    /**
     * Get the address property: Public IP address of the virtual machine.
     *
     * @return the address value.
     */
    public String address() {
        return this.address;
    }

    /**
     * Set the address property: Public IP address of the virtual machine.
     *
     * @param address the address value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withAddress(String address) {
        this.address = address;
        return this;
    }

    /**
     * Get the administratorAccount property: Admin credentials for virtual machine.
     *
     * @return the administratorAccount value.
     */
    public VirtualMachineSshCredentials administratorAccount() {
        return this.administratorAccount;
    }

    /**
     * Set the administratorAccount property: Admin credentials for virtual machine.
     *
     * @param administratorAccount the administratorAccount value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withAdministratorAccount(VirtualMachineSshCredentials administratorAccount) {
        this.administratorAccount = administratorAccount;
        return this;
    }

    /**
     * Get the isNotebookInstanceCompute property: Indicates whether this compute will be used for running notebooks.
     *
     * @return the isNotebookInstanceCompute value.
     */
    public Boolean isNotebookInstanceCompute() {
        return this.isNotebookInstanceCompute;
    }

    /**
     * Set the isNotebookInstanceCompute property: Indicates whether this compute will be used for running notebooks.
     *
     * @param isNotebookInstanceCompute the isNotebookInstanceCompute value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withIsNotebookInstanceCompute(Boolean isNotebookInstanceCompute) {
        this.isNotebookInstanceCompute = isNotebookInstanceCompute;
        return this;
    }

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