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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.scvmm.models.DynamicMemoryEnabled;
import com.azure.resourcemanager.scvmm.models.IsCustomizable;
import com.azure.resourcemanager.scvmm.models.LimitCpuForMigration;
import com.azure.resourcemanager.scvmm.models.NetworkInterfaces;
import com.azure.resourcemanager.scvmm.models.OsType;
import com.azure.resourcemanager.scvmm.models.VirtualDisk;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Defines the resource properties. */
@Fluent
public final class VirtualMachineTemplateProperties {
    /*
     * Gets or sets the inventory Item ID for the resource.
     */
    @JsonProperty(value = "inventoryItemId")
    private String inventoryItemId;

    /*
     * Unique ID of the virtual machine template.
     */
    @JsonProperty(value = "uuid")
    private String uuid;

    /*
     * ARM Id of the vmmServer resource in which this resource resides.
     */
    @JsonProperty(value = "vmmServerId")
    private String vmmServerId;

    /*
     * Gets or sets the type of the os.
     */
    @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY)
    private OsType osType;

    /*
     * Gets or sets os name.
     */
    @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY)
    private String osName;

    /*
     * Gets or sets computer name.
     */
    @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY)
    private String computerName;

    /*
     * MemoryMB is the desired size of a virtual machine's memory, in MB.
     */
    @JsonProperty(value = "memoryMB", access = JsonProperty.Access.WRITE_ONLY)
    private Integer memoryMB;

    /*
     * Gets or sets the desired number of vCPUs for the vm.
     */
    @JsonProperty(value = "cpuCount", access = JsonProperty.Access.WRITE_ONLY)
    private Integer cpuCount;

    /*
     * Gets or sets a value indicating whether to enable processor
     * compatibility mode for live migration of VMs.
     */
    @JsonProperty(value = "limitCpuForMigration", access = JsonProperty.Access.WRITE_ONLY)
    private LimitCpuForMigration limitCpuForMigration;

    /*
     * Gets or sets a value indicating whether to enable dynamic memory or not.
     */
    @JsonProperty(value = "dynamicMemoryEnabled", access = JsonProperty.Access.WRITE_ONLY)
    private DynamicMemoryEnabled dynamicMemoryEnabled;

    /*
     * Gets or sets a value indicating whether the vm template is customizable
     * or not.
     */
    @JsonProperty(value = "isCustomizable", access = JsonProperty.Access.WRITE_ONLY)
    private IsCustomizable isCustomizable;

    /*
     * Gets or sets the max dynamic memory for the vm.
     */
    @JsonProperty(value = "dynamicMemoryMaxMB", access = JsonProperty.Access.WRITE_ONLY)
    private Integer dynamicMemoryMaxMB;

    /*
     * Gets or sets the min dynamic memory for the vm.
     */
    @JsonProperty(value = "dynamicMemoryMinMB", access = JsonProperty.Access.WRITE_ONLY)
    private Integer dynamicMemoryMinMB;

    /*
     * Gets highly available property.
     */
    @JsonProperty(value = "isHighlyAvailable", access = JsonProperty.Access.WRITE_ONLY)
    private String isHighlyAvailable;

    /*
     * Gets or sets the generation for the vm.
     */
    @JsonProperty(value = "generation", access = JsonProperty.Access.WRITE_ONLY)
    private Integer generation;

    /*
     * Gets or sets the network interfaces of the template.
     */
    @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY)
    private List<NetworkInterfaces> networkInterfaces;

    /*
     * Gets or sets the disks of the template.
     */
    @JsonProperty(value = "disks", access = JsonProperty.Access.WRITE_ONLY)
    private List<VirtualDisk> disks;

    /*
     * Gets or sets the provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /**
     * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource.
     *
     * @return the inventoryItemId value.
     */
    public String inventoryItemId() {
        return this.inventoryItemId;
    }

    /**
     * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource.
     *
     * @param inventoryItemId the inventoryItemId value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withInventoryItemId(String inventoryItemId) {
        this.inventoryItemId = inventoryItemId;
        return this;
    }

    /**
     * Get the uuid property: Unique ID of the virtual machine template.
     *
     * @return the uuid value.
     */
    public String uuid() {
        return this.uuid;
    }

    /**
     * Set the uuid property: Unique ID of the virtual machine template.
     *
     * @param uuid the uuid value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withUuid(String uuid) {
        this.uuid = uuid;
        return this;
    }

    /**
     * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.
     *
     * @return the vmmServerId value.
     */
    public String vmmServerId() {
        return this.vmmServerId;
    }

    /**
     * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.
     *
     * @param vmmServerId the vmmServerId value to set.
     * @return the VirtualMachineTemplateProperties object itself.
     */
    public VirtualMachineTemplateProperties withVmmServerId(String vmmServerId) {
        this.vmmServerId = vmmServerId;
        return this;
    }

    /**
     * Get the osType property: Gets or sets the type of the os.
     *
     * @return the osType value.
     */
    public OsType osType() {
        return this.osType;
    }

    /**
     * Get the osName property: Gets or sets os name.
     *
     * @return the osName value.
     */
    public String osName() {
        return this.osName;
    }

    /**
     * Get the computerName property: Gets or sets computer name.
     *
     * @return the computerName value.
     */
    public String computerName() {
        return this.computerName;
    }

    /**
     * Get the memoryMB property: MemoryMB is the desired size of a virtual machine's memory, in MB.
     *
     * @return the memoryMB value.
     */
    public Integer memoryMB() {
        return this.memoryMB;
    }

    /**
     * Get the cpuCount property: Gets or sets the desired number of vCPUs for the vm.
     *
     * @return the cpuCount value.
     */
    public Integer cpuCount() {
        return this.cpuCount;
    }

    /**
     * Get the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility
     * mode for live migration of VMs.
     *
     * @return the limitCpuForMigration value.
     */
    public LimitCpuForMigration limitCpuForMigration() {
        return this.limitCpuForMigration;
    }

    /**
     * Get the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not.
     *
     * @return the dynamicMemoryEnabled value.
     */
    public DynamicMemoryEnabled dynamicMemoryEnabled() {
        return this.dynamicMemoryEnabled;
    }

    /**
     * Get the isCustomizable property: Gets or sets a value indicating whether the vm template is customizable or not.
     *
     * @return the isCustomizable value.
     */
    public IsCustomizable isCustomizable() {
        return this.isCustomizable;
    }

    /**
     * Get the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm.
     *
     * @return the dynamicMemoryMaxMB value.
     */
    public Integer dynamicMemoryMaxMB() {
        return this.dynamicMemoryMaxMB;
    }

    /**
     * Get the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm.
     *
     * @return the dynamicMemoryMinMB value.
     */
    public Integer dynamicMemoryMinMB() {
        return this.dynamicMemoryMinMB;
    }

    /**
     * Get the isHighlyAvailable property: Gets highly available property.
     *
     * @return the isHighlyAvailable value.
     */
    public String isHighlyAvailable() {
        return this.isHighlyAvailable;
    }

    /**
     * Get the generation property: Gets or sets the generation for the vm.
     *
     * @return the generation value.
     */
    public Integer generation() {
        return this.generation;
    }

    /**
     * Get the networkInterfaces property: Gets or sets the network interfaces of the template.
     *
     * @return the networkInterfaces value.
     */
    public List<NetworkInterfaces> networkInterfaces() {
        return this.networkInterfaces;
    }

    /**
     * Get the disks property: Gets or sets the disks of the template.
     *
     * @return the disks value.
     */
    public List<VirtualDisk> disks() {
        return this.disks;
    }

    /**
     * Get the provisioningState property: Gets or sets the provisioning state.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (networkInterfaces() != null) {
            networkInterfaces().forEach(e -> e.validate());
        }
        if (disks() != null) {
            disks().forEach(e -> e.validate());
        }
    }
}
