// 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.util.logging.ClientLogger;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualDisk;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualDiskController;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties of virtual machine template. */
@Fluent
public final class VirtualMachineTemplateProperties {
    /*
     * The amount of memory
     */
    @JsonProperty(value = "amountOfRam")
    private Integer amountOfRam;

    /*
     * The list of Virtual Disk Controllers
     */
    @JsonProperty(value = "controllers")
    private List<VirtualDiskController> controllers;

    /*
     * The description of Virtual Machine Template
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * The list of Virtual Disks
     */
    @JsonProperty(value = "disks")
    private List<VirtualDisk> disks;

    /*
     * Expose Guest OS or not
     */
    @JsonProperty(value = "exposeToGuestVM")
    private Boolean exposeToGuestVM;

    /*
     * The Guest OS
     */
    @JsonProperty(value = "guestOS", access = JsonProperty.Access.WRITE_ONLY)
    private String guestOS;

    /*
     * The Guest OS types
     */
    @JsonProperty(value = "guestOSType", access = JsonProperty.Access.WRITE_ONLY)
    private String guestOSType;

    /*
     * The list of Virtual NICs
     */
    @JsonProperty(value = "nics")
    private List<VirtualNicInner> nics;

    /*
     * The number of CPU cores
     */
    @JsonProperty(value = "numberOfCores")
    private Integer numberOfCores;

    /*
     * path to folder
     */
    @JsonProperty(value = "path")
    private String path;

    /*
     * The Private Cloud Id
     */
    @JsonProperty(value = "privateCloudId", required = true)
    private String privateCloudId;

    /*
     * The list of VSphere networks
     */
    @JsonProperty(value = "vSphereNetworks")
    private List<String> vSphereNetworks;

    /*
     * The tags from VSphere
     */
    @JsonProperty(value = "vSphereTags")
    private List<String> vSphereTags;

    /*
     * The VMware tools version
     */
    @JsonProperty(value = "vmwaretools", access = JsonProperty.Access.WRITE_ONLY)
    private String vmwaretools;

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

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

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

    /**
     * Get the controllers property: The list of Virtual Disk Controllers.
     *
     * @return the controllers value.
     */
    public List<VirtualDiskController> controllers() {
        return this.controllers;
    }

    /**
     * Set the controllers property: The list of Virtual Disk Controllers.
     *
     * @param controllers the controllers value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withControllers(List<VirtualDiskController> controllers) {
        this.controllers = controllers;
        return this;
    }

    /**
     * Get the description property: The description of Virtual Machine Template.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: The description of Virtual Machine Template.
     *
     * @param description the description value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withDescription(String description) {
        this.description = description;
        return this;
    }

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

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

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

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

    /**
     * Get the guestOS property: The Guest OS.
     *
     * @return the guestOS value.
     */
    public String guestOS() {
        return this.guestOS;
    }

    /**
     * Get the guestOSType property: The Guest OS types.
     *
     * @return the guestOSType value.
     */
    public String guestOSType() {
        return this.guestOSType;
    }

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

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

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

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

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

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

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

    /**
     * Set the privateCloudId property: The Private Cloud Id.
     *
     * @param privateCloudId the privateCloudId value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withPrivateCloudId(String privateCloudId) {
        this.privateCloudId = privateCloudId;
        return this;
    }

    /**
     * Get the vSphereNetworks property: The list of VSphere networks.
     *
     * @return the vSphereNetworks value.
     */
    public List<String> vSphereNetworks() {
        return this.vSphereNetworks;
    }

    /**
     * Set the vSphereNetworks property: The list of VSphere networks.
     *
     * @param vSphereNetworks the vSphereNetworks value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withVSphereNetworks(List<String> vSphereNetworks) {
        this.vSphereNetworks = vSphereNetworks;
        return this;
    }

    /**
     * Get the vSphereTags property: The tags from VSphere.
     *
     * @return the vSphereTags value.
     */
    public List<String> vSphereTags() {
        return this.vSphereTags;
    }

    /**
     * Set the vSphereTags property: The tags from VSphere.
     *
     * @param vSphereTags the vSphereTags value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withVSphereTags(List<String> vSphereTags) {
        this.vSphereTags = vSphereTags;
        return this;
    }

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

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (controllers() != null) {
            controllers().forEach(e -> e.validate());
        }
        if (disks() != null) {
            disks().forEach(e -> e.validate());
        }
        if (nics() != null) {
            nics().forEach(e -> e.validate());
        }
        if (privateCloudId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property privateCloudId in model VirtualMachineTemplateProperties"));
        }
    }

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