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

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The VirtualMachineSchemaProperties model. */
@Fluent
public final class VirtualMachineSchemaProperties {
    /*
     * Virtual Machine size
     */
    @JsonProperty(value = "virtualMachineSize")
    private String virtualMachineSize;

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

    /*
     * Notebook server port open for ssh connections.
     */
    @JsonProperty(value = "notebookServerPort")
    private Integer notebookServerPort;

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

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

    /**
     * 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 VirtualMachineSchemaProperties object itself.
     */
    public VirtualMachineSchemaProperties 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 VirtualMachineSchemaProperties object itself.
     */
    public VirtualMachineSchemaProperties withSshPort(Integer sshPort) {
        this.sshPort = sshPort;
        return this;
    }

    /**
     * Get the notebookServerPort property: Notebook server port open for ssh connections.
     *
     * @return the notebookServerPort value.
     */
    public Integer notebookServerPort() {
        return this.notebookServerPort;
    }

    /**
     * Set the notebookServerPort property: Notebook server port open for ssh connections.
     *
     * @param notebookServerPort the notebookServerPort value to set.
     * @return the VirtualMachineSchemaProperties object itself.
     */
    public VirtualMachineSchemaProperties withNotebookServerPort(Integer notebookServerPort) {
        this.notebookServerPort = notebookServerPort;
        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 VirtualMachineSchemaProperties object itself.
     */
    public VirtualMachineSchemaProperties 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 VirtualMachineSchemaProperties object itself.
     */
    public VirtualMachineSchemaProperties 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 VirtualMachineSchemaProperties object itself.
     */
    public VirtualMachineSchemaProperties 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();
        }
    }
}
