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

package com.azure.resourcemanager.vmwarecloudsimple.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.vmwarecloudsimple.models.GuestOSCustomization;
import com.azure.resourcemanager.vmwarecloudsimple.models.GuestOSType;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualDisk;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualDiskController;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualMachineStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Virtual machine model. */
@Fluent
public final class VirtualMachineInner extends Resource {
    /*
     * Virtual machine properties
     */
    @JsonProperty(value = "properties")
    private VirtualMachinePropertiesInner innerProperties;

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

    /**
     * Get the innerProperties property: Virtual machine properties.
     *
     * @return the innerProperties value.
     */
    private VirtualMachinePropertiesInner innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public VirtualMachineInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public VirtualMachineInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the amountOfRam property: The amount of memory.
     *
     * @return the amountOfRam value.
     */
    public Integer amountOfRam() {
        return this.innerProperties() == null ? null : this.innerProperties().amountOfRam();
    }

    /**
     * Set the amountOfRam property: The amount of memory.
     *
     * @param amountOfRam the amountOfRam value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withAmountOfRam(Integer amountOfRam) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withAmountOfRam(amountOfRam);
        return this;
    }

    /**
     * Get the controllers property: The list of Virtual Disks' Controllers.
     *
     * @return the controllers value.
     */
    public List<VirtualDiskController> controllers() {
        return this.innerProperties() == null ? null : this.innerProperties().controllers();
    }

    /**
     * Get the customization property: Virtual machine properties.
     *
     * @return the customization value.
     */
    public GuestOSCustomization customization() {
        return this.innerProperties() == null ? null : this.innerProperties().customization();
    }

    /**
     * Set the customization property: Virtual machine properties.
     *
     * @param customization the customization value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withCustomization(GuestOSCustomization customization) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withCustomization(customization);
        return this;
    }

    /**
     * Get the disks property: The list of Virtual Disks.
     *
     * @return the disks value.
     */
    public List<VirtualDisk> disks() {
        return this.innerProperties() == null ? null : this.innerProperties().disks();
    }

    /**
     * Set the disks property: The list of Virtual Disks.
     *
     * @param disks the disks value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withDisks(List<VirtualDisk> disks) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withDisks(disks);
        return this;
    }

    /**
     * Get the dnsname property: The DNS name of Virtual Machine in VCenter.
     *
     * @return the dnsname value.
     */
    public String dnsname() {
        return this.innerProperties() == null ? null : this.innerProperties().dnsname();
    }

    /**
     * Get the exposeToGuestVM property: Expose Guest OS or not.
     *
     * @return the exposeToGuestVM value.
     */
    public Boolean exposeToGuestVM() {
        return this.innerProperties() == null ? null : this.innerProperties().exposeToGuestVM();
    }

    /**
     * Set the exposeToGuestVM property: Expose Guest OS or not.
     *
     * @param exposeToGuestVM the exposeToGuestVM value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withExposeToGuestVM(Boolean exposeToGuestVM) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withExposeToGuestVM(exposeToGuestVM);
        return this;
    }

    /**
     * Get the folder property: The path to virtual machine folder in VCenter.
     *
     * @return the folder value.
     */
    public String folder() {
        return this.innerProperties() == null ? null : this.innerProperties().folder();
    }

    /**
     * Get the guestOS property: The name of Guest OS.
     *
     * @return the guestOS value.
     */
    public String guestOS() {
        return this.innerProperties() == null ? null : this.innerProperties().guestOS();
    }

    /**
     * Get the guestOSType property: The Guest OS type.
     *
     * @return the guestOSType value.
     */
    public GuestOSType guestOSType() {
        return this.innerProperties() == null ? null : this.innerProperties().guestOSType();
    }

    /**
     * Get the nics property: The list of Virtual NICs.
     *
     * @return the nics value.
     */
    public List<VirtualNicInner> nics() {
        return this.innerProperties() == null ? null : this.innerProperties().nics();
    }

    /**
     * Set the nics property: The list of Virtual NICs.
     *
     * @param nics the nics value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withNics(List<VirtualNicInner> nics) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withNics(nics);
        return this;
    }

    /**
     * Get the numberOfCores property: The number of CPU cores.
     *
     * @return the numberOfCores value.
     */
    public Integer numberOfCores() {
        return this.innerProperties() == null ? null : this.innerProperties().numberOfCores();
    }

    /**
     * Set the numberOfCores property: The number of CPU cores.
     *
     * @param numberOfCores the numberOfCores value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withNumberOfCores(Integer numberOfCores) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withNumberOfCores(numberOfCores);
        return this;
    }

    /**
     * Get the password property: Password for login. Deprecated - use customization property.
     *
     * @return the password value.
     */
    public String password() {
        return this.innerProperties() == null ? null : this.innerProperties().password();
    }

    /**
     * Set the password property: Password for login. Deprecated - use customization property.
     *
     * @param password the password value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withPassword(String password) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withPassword(password);
        return this;
    }

    /**
     * Get the privateCloudId property: Private Cloud Id.
     *
     * @return the privateCloudId value.
     */
    public String privateCloudId() {
        return this.innerProperties() == null ? null : this.innerProperties().privateCloudId();
    }

    /**
     * Set the privateCloudId property: Private Cloud Id.
     *
     * @param privateCloudId the privateCloudId value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withPrivateCloudId(String privateCloudId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withPrivateCloudId(privateCloudId);
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning status of the resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the publicIp property: The public ip of Virtual Machine.
     *
     * @return the publicIp value.
     */
    public String publicIp() {
        return this.innerProperties() == null ? null : this.innerProperties().publicIp();
    }

    /**
     * Get the resourcePool property: Virtual Machines Resource Pool.
     *
     * @return the resourcePool value.
     */
    public ResourcePoolInner resourcePool() {
        return this.innerProperties() == null ? null : this.innerProperties().resourcePool();
    }

    /**
     * Set the resourcePool property: Virtual Machines Resource Pool.
     *
     * @param resourcePool the resourcePool value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withResourcePool(ResourcePoolInner resourcePool) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withResourcePool(resourcePool);
        return this;
    }

    /**
     * Get the status property: The status of Virtual machine.
     *
     * @return the status value.
     */
    public VirtualMachineStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Get the templateId property: Virtual Machine Template Id.
     *
     * @return the templateId value.
     */
    public String templateId() {
        return this.innerProperties() == null ? null : this.innerProperties().templateId();
    }

    /**
     * Set the templateId property: Virtual Machine Template Id.
     *
     * @param templateId the templateId value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withTemplateId(String templateId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withTemplateId(templateId);
        return this;
    }

    /**
     * Get the username property: Username for login. Deprecated - use customization property.
     *
     * @return the username value.
     */
    public String username() {
        return this.innerProperties() == null ? null : this.innerProperties().username();
    }

    /**
     * Set the username property: Username for login. Deprecated - use customization property.
     *
     * @param username the username value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withUsername(String username) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withUsername(username);
        return this;
    }

    /**
     * Get the vSphereNetworks property: The list of Virtual VSphere Networks.
     *
     * @return the vSphereNetworks value.
     */
    public List<String> vSphereNetworks() {
        return this.innerProperties() == null ? null : this.innerProperties().vSphereNetworks();
    }

    /**
     * Set the vSphereNetworks property: The list of Virtual VSphere Networks.
     *
     * @param vSphereNetworks the vSphereNetworks value to set.
     * @return the VirtualMachineInner object itself.
     */
    public VirtualMachineInner withVSphereNetworks(List<String> vSphereNetworks) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachinePropertiesInner();
        }
        this.innerProperties().withVSphereNetworks(vSphereNetworks);
        return this;
    }

    /**
     * Get the vmId property: The internal id of Virtual Machine in VCenter.
     *
     * @return the vmId value.
     */
    public String vmId() {
        return this.innerProperties() == null ? null : this.innerProperties().vmId();
    }

    /**
     * Get the vmwaretools property: VMware tools version.
     *
     * @return the vmwaretools value.
     */
    public String vmwaretools() {
        return this.innerProperties() == null ? null : this.innerProperties().vmwaretools();
    }

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