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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.connectedvmware.models.FirmwareType;
import com.azure.resourcemanager.connectedvmware.models.GuestAgentProfile;
import com.azure.resourcemanager.connectedvmware.models.HardwareProfile;
import com.azure.resourcemanager.connectedvmware.models.NetworkProfile;
import com.azure.resourcemanager.connectedvmware.models.OsProfile;
import com.azure.resourcemanager.connectedvmware.models.PlacementProfile;
import com.azure.resourcemanager.connectedvmware.models.ResourceStatus;
import com.azure.resourcemanager.connectedvmware.models.SecurityProfile;
import com.azure.resourcemanager.connectedvmware.models.StorageProfile;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Defines the resource properties. */
@Fluent
public final class VirtualMachineProperties {
    /*
     * Gets or sets the ARM Id of the resourcePool resource on which this virtual machine will
     * deploy.
     */
    @JsonProperty(value = "resourcePoolId")
    private String resourcePoolId;

    /*
     * Gets or sets the ARM Id of the template resource to deploy the virtual machine.
     */
    @JsonProperty(value = "templateId")
    private String templateId;

    /*
     * Gets or sets the ARM Id of the vCenter resource in which this resource pool resides.
     */
    @JsonProperty(value = "vCenterId")
    private String vCenterId;

    /*
     * Placement properties.
     */
    @JsonProperty(value = "placementProfile")
    private PlacementProfile placementProfile;

    /*
     * OS properties.
     */
    @JsonProperty(value = "osProfile")
    private OsProfile osProfile;

    /*
     * Hardware properties.
     */
    @JsonProperty(value = "hardwareProfile")
    private HardwareProfile hardwareProfile;

    /*
     * Network properties.
     */
    @JsonProperty(value = "networkProfile")
    private NetworkProfile networkProfile;

    /*
     * Storage properties.
     */
    @JsonProperty(value = "storageProfile")
    private StorageProfile storageProfile;

    /*
     * Guest agent status properties.
     */
    @JsonProperty(value = "guestAgentProfile")
    private GuestAgentProfile guestAgentProfile;

    /*
     * Gets the security profile.
     */
    @JsonProperty(value = "securityProfile")
    private SecurityProfile securityProfile;

    /*
     * Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine.
     */
    @JsonProperty(value = "moRefId")
    private String moRefId;

    /*
     * Gets or sets the inventory Item ID for the virtual machine.
     */
    @JsonProperty(value = "inventoryItemId")
    private String inventoryItemId;

    /*
     * Gets or sets the vCenter Managed Object name for the virtual machine.
     */
    @JsonProperty(value = "moName", access = JsonProperty.Access.WRITE_ONLY)
    private String moName;

    /*
     * Gets or sets the folder path of the vm.
     */
    @JsonProperty(value = "folderPath", access = JsonProperty.Access.WRITE_ONLY)
    private String folderPath;

    /*
     * Gets or sets the instance uuid of the vm.
     */
    @JsonProperty(value = "instanceUuid", access = JsonProperty.Access.WRITE_ONLY)
    private String instanceUuid;

    /*
     * Gets or sets the SMBIOS UUID of the vm.
     */
    @JsonProperty(value = "smbiosUuid")
    private String smbiosUuid;

    /*
     * Firmware type
     */
    @JsonProperty(value = "firmwareType")
    private FirmwareType firmwareType;

    /*
     * Gets the power state of the virtual machine.
     */
    @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY)
    private String powerState;

    /*
     * Gets the name of the corresponding resource in Kubernetes.
     */
    @JsonProperty(value = "customResourceName", access = JsonProperty.Access.WRITE_ONLY)
    private String customResourceName;

    /*
     * Gets or sets a unique identifier for this resource.
     */
    @JsonProperty(value = "uuid", access = JsonProperty.Access.WRITE_ONLY)
    private String uuid;

    /*
     * The resource status information.
     */
    @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY)
    private List<ResourceStatus> statuses;

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

    /*
     * Gets or sets a unique identifier for the vm resource.
     */
    @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY)
    private String vmId;

    /**
     * Get the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual
     * machine will deploy.
     *
     * @return the resourcePoolId value.
     */
    public String resourcePoolId() {
        return this.resourcePoolId;
    }

    /**
     * Set the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual
     * machine will deploy.
     *
     * @param resourcePoolId the resourcePoolId value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withResourcePoolId(String resourcePoolId) {
        this.resourcePoolId = resourcePoolId;
        return this;
    }

    /**
     * Get the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine.
     *
     * @return the templateId value.
     */
    public String templateId() {
        return this.templateId;
    }

    /**
     * Set the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine.
     *
     * @param templateId the templateId value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withTemplateId(String templateId) {
        this.templateId = templateId;
        return this;
    }

    /**
     * Get the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides.
     *
     * @return the vCenterId value.
     */
    public String vCenterId() {
        return this.vCenterId;
    }

    /**
     * Set the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides.
     *
     * @param vCenterId the vCenterId value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withVCenterId(String vCenterId) {
        this.vCenterId = vCenterId;
        return this;
    }

    /**
     * Get the placementProfile property: Placement properties.
     *
     * @return the placementProfile value.
     */
    public PlacementProfile placementProfile() {
        return this.placementProfile;
    }

    /**
     * Set the placementProfile property: Placement properties.
     *
     * @param placementProfile the placementProfile value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withPlacementProfile(PlacementProfile placementProfile) {
        this.placementProfile = placementProfile;
        return this;
    }

    /**
     * Get the osProfile property: OS properties.
     *
     * @return the osProfile value.
     */
    public OsProfile osProfile() {
        return this.osProfile;
    }

    /**
     * Set the osProfile property: OS properties.
     *
     * @param osProfile the osProfile value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withOsProfile(OsProfile osProfile) {
        this.osProfile = osProfile;
        return this;
    }

    /**
     * Get the hardwareProfile property: Hardware properties.
     *
     * @return the hardwareProfile value.
     */
    public HardwareProfile hardwareProfile() {
        return this.hardwareProfile;
    }

    /**
     * Set the hardwareProfile property: Hardware properties.
     *
     * @param hardwareProfile the hardwareProfile value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withHardwareProfile(HardwareProfile hardwareProfile) {
        this.hardwareProfile = hardwareProfile;
        return this;
    }

    /**
     * Get the networkProfile property: Network properties.
     *
     * @return the networkProfile value.
     */
    public NetworkProfile networkProfile() {
        return this.networkProfile;
    }

    /**
     * Set the networkProfile property: Network properties.
     *
     * @param networkProfile the networkProfile value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withNetworkProfile(NetworkProfile networkProfile) {
        this.networkProfile = networkProfile;
        return this;
    }

    /**
     * Get the storageProfile property: Storage properties.
     *
     * @return the storageProfile value.
     */
    public StorageProfile storageProfile() {
        return this.storageProfile;
    }

    /**
     * Set the storageProfile property: Storage properties.
     *
     * @param storageProfile the storageProfile value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withStorageProfile(StorageProfile storageProfile) {
        this.storageProfile = storageProfile;
        return this;
    }

    /**
     * Get the guestAgentProfile property: Guest agent status properties.
     *
     * @return the guestAgentProfile value.
     */
    public GuestAgentProfile guestAgentProfile() {
        return this.guestAgentProfile;
    }

    /**
     * Set the guestAgentProfile property: Guest agent status properties.
     *
     * @param guestAgentProfile the guestAgentProfile value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withGuestAgentProfile(GuestAgentProfile guestAgentProfile) {
        this.guestAgentProfile = guestAgentProfile;
        return this;
    }

    /**
     * Get the securityProfile property: Gets the security profile.
     *
     * @return the securityProfile value.
     */
    public SecurityProfile securityProfile() {
        return this.securityProfile;
    }

    /**
     * Set the securityProfile property: Gets the security profile.
     *
     * @param securityProfile the securityProfile value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withSecurityProfile(SecurityProfile securityProfile) {
        this.securityProfile = securityProfile;
        return this;
    }

    /**
     * Get the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine.
     *
     * @return the moRefId value.
     */
    public String moRefId() {
        return this.moRefId;
    }

    /**
     * Set the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine.
     *
     * @param moRefId the moRefId value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withMoRefId(String moRefId) {
        this.moRefId = moRefId;
        return this;
    }

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

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

    /**
     * Get the moName property: Gets or sets the vCenter Managed Object name for the virtual machine.
     *
     * @return the moName value.
     */
    public String moName() {
        return this.moName;
    }

    /**
     * Get the folderPath property: Gets or sets the folder path of the vm.
     *
     * @return the folderPath value.
     */
    public String folderPath() {
        return this.folderPath;
    }

    /**
     * Get the instanceUuid property: Gets or sets the instance uuid of the vm.
     *
     * @return the instanceUuid value.
     */
    public String instanceUuid() {
        return this.instanceUuid;
    }

    /**
     * Get the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm.
     *
     * @return the smbiosUuid value.
     */
    public String smbiosUuid() {
        return this.smbiosUuid;
    }

    /**
     * Set the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm.
     *
     * @param smbiosUuid the smbiosUuid value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withSmbiosUuid(String smbiosUuid) {
        this.smbiosUuid = smbiosUuid;
        return this;
    }

    /**
     * Get the firmwareType property: Firmware type.
     *
     * @return the firmwareType value.
     */
    public FirmwareType firmwareType() {
        return this.firmwareType;
    }

    /**
     * Set the firmwareType property: Firmware type.
     *
     * @param firmwareType the firmwareType value to set.
     * @return the VirtualMachineProperties object itself.
     */
    public VirtualMachineProperties withFirmwareType(FirmwareType firmwareType) {
        this.firmwareType = firmwareType;
        return this;
    }

    /**
     * Get the powerState property: Gets the power state of the virtual machine.
     *
     * @return the powerState value.
     */
    public String powerState() {
        return this.powerState;
    }

    /**
     * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes.
     *
     * @return the customResourceName value.
     */
    public String customResourceName() {
        return this.customResourceName;
    }

    /**
     * Get the uuid property: Gets or sets a unique identifier for this resource.
     *
     * @return the uuid value.
     */
    public String uuid() {
        return this.uuid;
    }

    /**
     * Get the statuses property: The resource status information.
     *
     * @return the statuses value.
     */
    public List<ResourceStatus> statuses() {
        return this.statuses;
    }

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

    /**
     * Get the vmId property: Gets or sets a unique identifier for the vm resource.
     *
     * @return the vmId value.
     */
    public String vmId() {
        return this.vmId;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (placementProfile() != null) {
            placementProfile().validate();
        }
        if (osProfile() != null) {
            osProfile().validate();
        }
        if (hardwareProfile() != null) {
            hardwareProfile().validate();
        }
        if (networkProfile() != null) {
            networkProfile().validate();
        }
        if (storageProfile() != null) {
            storageProfile().validate();
        }
        if (guestAgentProfile() != null) {
            guestAgentProfile().validate();
        }
        if (securityProfile() != null) {
            securityProfile().validate();
        }
        if (statuses() != null) {
            statuses().forEach(e -> e.validate());
        }
    }
}
